DaFuWeng/assets/GlobalScript/Animation/AnimationNode.ts

22 lines
508 B
TypeScript
Raw Normal View History

2024-03-11 17:37:03 +08:00
import { _decorator, Component, Node } from 'cc';
import { ScriptMyAnimation } from './ScriptMyAnimation';
const { ccclass, property } = _decorator;
@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);
}
}