背后载入

This commit is contained in:
2024-07-22 16:49:11 +08:00
parent e3b5f4bd05
commit 5c961f1f37
44 changed files with 1020 additions and 109 deletions

View File

@@ -23,51 +23,6 @@ export default class RoleSpineAnimator extends Component {
this.spine = this.getComponent(sp.Skeleton)!;
console.log("RoleSpineAnimator start smc.heros",smc.heros);
let heros=smc.heros
if(heros.length>0){
/**
* 取第一个heros
*/
this.spine.setSkin(heros[0])
console.log("RoleSpineAnimator setSkin", heros[0]);
switch (heros[0]) {
case 'war':
this.spine.setAnimation(0, 'idle', true)
break;
case 'magic':
this.spine.setAnimation(0, 'idle', true)
break;
case 'heath':
this.spine.setAnimation(0, 'idle', true)
break;
default:
this.spine.setAnimation(0, 'idle', true)
break;
}
//移除smc.heros[0],heros key 重新取
heros.splice(0,1)
smc.heros=heros
}else if(smc.monsters.length>0){
this.spine.setSkin(smc.monsters[0])
console.log("RoleSpineAnimator setSkin", smc.monsters[0]);
switch (smc.monsters[0]) {
case 'war':
this.spine.setAnimation(0, 'idle', true)
break;
case 'magic':
this.spine.setAnimation(0, 'idle', true)
break;
case 'heath':
this.spine.setAnimation(0, 'idle', true)
break;
default:
this.spine.setAnimation(0, 'idle', true)
break;
}
}
}
lateUpdate(dt: number) {