Cpk0521 / WDS_Adv_Player

A self-made adv player for render the World Dai Star(世界大明星) in-game story
https://cpk0521.github.io/WDS_Adv_Player/
4 stars 1 forks source link

spine eye Animation #4

Closed Cpk0521 closed 1 month ago

Cpk0521 commented 1 month ago

EyeBlink loop problem

Cpk0521 commented 1 month ago

找不到相關api 只能這樣做

_eyeBlinkAnimation(trackIndex: number, animationName: string, time : number = 1){
        this._model.state.setAnimation(trackIndex, animationName, false);
        this._model.state.tracks[trackIndex].listener = {
            complete : () => {
                clearTimeout(this._eyeBlinkTimeout);
                this._eyeBlinkTimeout = setTimeout(()=>{
                    this._eyeBlinkAnimation(trackIndex, animationName, time);
                }, time * 1000)
            }
        }
    }