| | |
| | | /// </summary> |
| | | public class MotionBase |
| | | { |
| | | public static float MotionTimeScale = 2f; |
| | | |
| | | public static List<string> AttackMotionList = new List<string> |
| | | { |
| | | MotionName.attack.ToString(), |
| | |
| | | if (skeletonGraphic != null) |
| | | { |
| | | spineAnimationState = skeletonGraphic.AnimationState; |
| | | spineAnimationState.TimeScale = MotionTimeScale; |
| | | skeletonGraphic.timeScale = MotionTimeScale; |
| | | |
| | | skeleton = skeletonGraphic.Skeleton; |
| | | |
| | | // 设置动画混合时间 |
| | |
| | | { |
| | | Debug.LogError("缺少SkeletonGraphic组件!"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public virtual void Release() |
| | |
| | | |
| | | public virtual void Pause() |
| | | { |
| | | if (currentTrackEntry != null) |
| | | currentTrackEntry.TimeScale = 0f; |
| | | spineAnimationState.TimeScale = 0f; |
| | | skeletonGraphic.timeScale = 0f; |
| | | } |
| | | |
| | | public virtual void Resume() |
| | | { |
| | | if (currentTrackEntry != null) |
| | | currentTrackEntry.TimeScale = 1f; |
| | | spineAnimationState.TimeScale = MotionTimeScale; |
| | | skeletonGraphic.timeScale = MotionTimeScale; |
| | | } |
| | | |
| | | #endregion |