-
Creator 版本:V2.3.4
-
目标平台: web
-
详细报错信息,包含调用堆栈:
-
重现方式:
-
之前哪个版本是正常的 :
-
手机型号 :
-
手机浏览器 :
-
编辑器操作系统 :
-
编辑器之前是否有其它报错 :
-
出现概率:
-
额外线索:在用js写脚本的时候 获取到animationState中的name 但是输出isPlaying的时候 报错为undefined 想问一下各位大佬
start () {
//当a d都没有按下时
this.input_flag = 0;
this.play_flag = true;
this.anim = this.getComponent(cc.Animation);
this.animState = this.anim.play('奔跑');
this.name = this.animState.name;
this.playing = this.animState.isPlaying;
},
onKeyDown: function (event) {
let keyCode = event.keyCode;
switch(keyCode) {
// 向左走
case cc.macro.KEY.a:
console.log('我按下了A');
this._armatureDisPlay.playAnimation('奔跑', 1);
console.log('动画的名字:'+ this.name);
console.log('动画的播放状态:'+ this.playing);
break;
}
},