技能动画 继续完善
This commit is contained in:
22
assets/script/game/skills/EndAnmCom.ts
Normal file
22
assets/script/game/skills/EndAnmCom.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { _decorator, Animation, Component, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EndAnmCom')
|
||||
export class EndAnmCom extends Component {
|
||||
start() {
|
||||
let anim = this.node.getComponent(Animation);
|
||||
console.log("动画",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
onAnimationFinished(){
|
||||
console.log("动画播放完毕")
|
||||
let bese = this.node.getComponent(SkillCom)
|
||||
bese.is_destroy = true
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user