fail_ani.ts 570 B

12345678910111213141516171819202122
  1. import { _decorator, Animation, Component, Node } from 'cc';
  2. import { gameManager } from '../gameManager';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('fail_ani')
  5. export class fail_ani extends Component {
  6. public Play(){
  7. this.node.active =true;
  8. this.node.getComponent(Animation).play()
  9. this.scheduleOnce(()=>{
  10. this.hideAndStop()
  11. },1.5)
  12. gameManager.Singleton.sys_fail_attack_music()
  13. }
  14. public hideAndStop(){
  15. this.node.getComponent(Animation).stop()
  16. this.node.active =false;
  17. }
  18. }