const animationComponent = i.addComponent(Animation); if(animationComponent){ const component = animationComponent.getComponent(Animation); if(component){ resources.load("Animation/toRight", AnimationClip, (err, clip) => { component.addClip(clip, "toRight"); component.play("toRight"); }); } }
注意调用
文章后续修改
标签:load,cocos,函数,toRight,component,animationComponent,Animation,resources From: https://www.cnblogs.com/kekit-rei/p/17578226.html