laya spine事件
// 加载完成事件 this.spine.on(Laya.Event.READY, this, ()=>{ let skinName: string = "test"; // 更换已存在的皮肤 this.spine.showSkinByName(skinName); }); // spine触发事件 this.Spine_bg.on(Laya.Event.LABEL,this,this.lableEvnent); lableEvnent(event:any){ if(event.name == "shuzi"){ this.font_clip.visible = true; }else if(event.name == "xuanzhuan"){ this.box_items.visible = true this.Img_light.visible = true this.Img_light.x = this._ptLightArray[0].x; this.Img_light.y = this._ptLightArray[0].y; this.beginLightAni(); }else if(event.name == "jieshu"){ if(this._winMj > 0){ this.Spine_get.visible = true; // spine播放完成事件 this.Spine_get.on(Laya.Event.STOPPED,this,this.delay); if(this.Spine_get.templet){ this.Spine_get.play(0,false); } }else{ this.Spine_none.visible = true; this.Spine_none.on(Laya.Event.STOPPED,this,this.delay); if(this.Spine_none.templet){ this.Spine_none.play(0,false); } } } }
laya 3.0.10有效
浙公网安备 33010602011771号