DaFuWeng/assets/GlobalScript/Animation/AnimationNode.ts

20 lines
435 B
TypeScript

import { _decorator, Component, Node } from 'cc';
import { ScriptMyAnimation } from './ScriptMyAnimation';
const { ccclass, property } = _decorator;
@ccclass('AnimationNode')
export class AnimationNode extends Node{
constructor(AnimationPath: string) {
super();
let aniNode = new Node();
aniNode.addComponent( ScriptMyAnimation).AnimationPath = AnimationPath;
this.addChild(aniNode);
}
}