角色 停止后 切换到idle动画
This commit is contained in:
@@ -89,6 +89,7 @@ export default class HeroAnmComp extends Component{
|
||||
if (this._hasStop) {
|
||||
this.spine?.setToSetupPose();
|
||||
}
|
||||
// console.log("do move",this.spine?.animation);
|
||||
this.spine?.setAnimation(0, 'Walking', true);
|
||||
this.default_anim='Walking'
|
||||
this._hasStop = false;
|
||||
@@ -105,6 +106,8 @@ export default class HeroAnmComp extends Component{
|
||||
}
|
||||
idle () {
|
||||
this.spine?.setToSetupPose();
|
||||
if(this.spine?.animation==='Idle') return
|
||||
// console.log("do idle",this.spine.animation);
|
||||
this.spine?.setAnimation(0, 'Idle', true);
|
||||
this.default_anim='Idle'
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export class HeroSpine extends Component {
|
||||
@property(HeroAnmComp)
|
||||
anm: HeroAnmComp = null;
|
||||
|
||||
status:string="Idle";
|
||||
status:string="idle";
|
||||
|
||||
onLoad() {
|
||||
// 角色控制组件
|
||||
@@ -36,9 +36,10 @@ export class HeroSpine extends Component {
|
||||
|
||||
}
|
||||
idle(){
|
||||
// console.log("change to idle",this.status);
|
||||
// console.log("do Idle");
|
||||
if(this.status=="Idle") return
|
||||
this.status="Idle"
|
||||
if(this.status=="idle") return
|
||||
this.status="idle"
|
||||
this.anm.idle()
|
||||
}
|
||||
atk() {
|
||||
@@ -67,7 +68,7 @@ export class HeroSpine extends Component {
|
||||
}
|
||||
|
||||
move(){
|
||||
// console.log("doing move");
|
||||
// console.log("change to move",this.status);
|
||||
if(this.status=="move") return
|
||||
this.status="move"
|
||||
this.anm.move()
|
||||
|
||||
Reference in New Issue
Block a user