DaFuWeng/assets/GlobalScript/Animation/AnimationNode.ts

29 lines
620 B
TypeScript
Raw Normal View History

/*
* @Author: WoNiu
* @Date: 2024-03-11 12:16:36
* @LastEditTime: 2024-03-26 15:40:23
* @LastEditors: WoNiu
* @Description:
*/
import { _decorator, Node } from 'cc';
2024-03-11 17:37:03 +08:00
import { ScriptMyAnimation } from './ScriptMyAnimation';
const { ccclass } = _decorator;
2024-03-11 17:37:03 +08:00
@ccclass('AnimationNode')
export class AnimationNode extends Node{
constructor(AnimationPath: string,aniDone?:Function) {
2024-03-11 17:37:03 +08:00
super();
let aniNode = new Node();
let ani = aniNode.addComponent( ScriptMyAnimation)
ani.AnimationPath = AnimationPath;
ani.onAniDone = aniDone;
2024-03-11 17:37:03 +08:00
this.addChild(aniNode);
}
}