You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
856 B
30 lines
856 B
import { _decorator, Component, sp } from "cc";
|
|
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass
|
|
export default class BombSpine extends Component {
|
|
Sk: sp.Skeleton = null;
|
|
|
|
protected onLoad(): void {
|
|
this.Sk = this.node.getComponentInChildren(sp.Skeleton);
|
|
}
|
|
/**播放技能动画 */
|
|
public playSpine(name: string, callback: Function = null, timeScale = 1, loop = true) {
|
|
if(!this.Sk) {
|
|
this.Sk = this.node.getComponentInChildren(sp.Skeleton);
|
|
}
|
|
this.Sk.setCompleteListener(() => {
|
|
this.Sk.setCompleteListener(null);
|
|
if (callback) callback();
|
|
});
|
|
this.Sk.timeScale = timeScale * gg.game.CurentBattle.TimeScale;
|
|
this.Sk.setAnimation(0, name, loop);
|
|
}
|
|
/**销毁节点 */
|
|
destoryNode(){
|
|
gg.res.putNode(this.node)
|
|
}
|
|
}
|
|
|