This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-23 02:53:23 +08:00
parent c6710e7dfa
commit 26cc480866
27 changed files with 2061 additions and 988 deletions

View File

@@ -25,8 +25,6 @@ export class PetIcon extends Component {
info:PlayerPetOV;
onLoad(){
this.reset();
//监听
app.event.on(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this)
}
@@ -35,13 +33,6 @@ export class PetIcon extends Component {
app.event.off(PlayerPetEvent.UPDATE_INFO,this.onUpdateInfo,this)
}
//初始化
reset(){
this.starNode.active = false;
}
//信息更新
onUpdateInfo(info:PlayerPetOV){
if(this.info && info.petId == this.info.petId){
@@ -51,6 +42,9 @@ export class PetIcon extends Component {
//刷新页面
onUpdateView(){
this.starNode.active = false;
this.spine.skeletonData = app.battleRes.getRoleSpine(this.info.petTbId);
this.spine.setAnimation(0,UIPetAnim.std,true);
@@ -67,7 +61,6 @@ export class PetIcon extends Component {
//设置icon
set(info:PlayerPetOV){
this.reset();
this.info = info;
this.onUpdateView();
}