Monica @Monica:发现个问题,JS,TS版本的引擎出现的。有关于Skeleton动画的。
/**
*指定显示对象
*@param index
*/
__proto.showDisplayByIndex=function(index){
if (this._replaceDic[index])
index=this._replaceDic[index];
if (this.currSlotData && index >-1 && index < this.currSlotData.displayArr.length){
this.displayIndex=index;
this.currDisplayData=this.currSlotData.displayArr[index];
if (this.currDisplayData){
var tName=this.currDisplayData.name;
this.currTexture=this.templet.getTexture(tName);
if (this.currTexture && Render.isWebGL && this.currDisplayData.type==0 && this.currDisplayData.uvs){
this.currTexture=this.currDisplayData.createTexture(this.currTexture);
}
}
}else {
this.displayIndex=-1;
this.currDisplayData=null;
this.currTexture=null;
}
}
这个函数里 if (this._replaceDic[index]) 的这个判断有问题。如果我当前this._replaceDic[index]值是0,那么判断就会变成false了。也就是说如果我调用replaceSlotSkinByIndex("dianshu1",1, 0); 就导致我的插槽没办法正确显示皮肤了。目前我自己把判断改成了 if (this._replaceDic[index] == null) 来避免为0的时候跳过