guansss / pixi-live2d-display

A PixiJS plugin to display Live2D models of any kind.
https://guansss.github.io/pixi-live2d-display/
MIT License
823 stars 125 forks source link

设置循环动画 #96

Open MoroseYu opened 1 year ago

MoroseYu commented 1 year ago

根据某个事件触发 循环某套动作 使用了: model2.internalModel.motionManager.state.shouldRequestIdleMotion = () => false; model2.internalModel.motionManager.on('motionFinish', () => { setTimeout(() => model2.motion('pinch_out'), 10); }); 用这个方法,有个小问题是需要等上一个动作执行完成 才会循环播放pinch_out这套动作;

求教两个问题 1 如何能不等待上个动作执行完成 而立刻执行所需动作?; 2 那个方法 可以停止指定的循环动作 而恢复默认动作?; 恢复使用了 model2.internalModel.motionManager.state.shouldRequestIdleMotion = () => true; 貌似不管用;

由于刚刚开始学习 很小白的问题 望赐教~

Chaoray commented 1 year ago

可以看看文檔中的:State Management

透過改變播放動作的優先度可以直接執行動作
例如在一個NORMAL動作播放時加入一個FORCE層級的動作