[]replaceSlotSkinName对于spine换肤不成功
如题,调用replaceSlotSkinName之后皮肤没有更换,用的是spine官方的goblin例子,替换的图片全在atlas里
// 程序入口
class GameMain{
private m_skeleton : Laya.Skeleton;
private m_templet : Laya.Templet;
constructor()
{
Laya.init(1334,750,Laya.WebGL);
this.m_templet = new Laya.Templet();
this.m_templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
this.m_templet.on(Laya.Event.ERROR,this,this.onError);
this.m_templet.loadAni("res/spine/goblins/goblins.sk");
}
private onError():void
{
console.log("parse error");
}
private parseComplete() : void
{
let skeleton0 : Laya.Skeleton;
skeleton0 = this.m_templet.buildArmature(1);
skeleton0.pos(200,700);
skeleton0.showSkinByIndex(1);
Laya.stage.addChild(skeleton0);
skeleton0.replaceSlotSkinName("head","goblin/head","goblingirl/head");
skeleton0.play("walk",true,true,0,0,true);
}
}
new GameMain();
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
Aar0n
赞同来自:
zh1988a
赞同来自:
linchenrr
赞同来自: