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); } }