背后载入
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user