| | |
| | | #endregion |
| | | |
| | | private Spine.TrackEntry currentTrackEntry; |
| | | |
| | | // 残影生成器 |
| | | private SkeletonIllusionShadow illusionShadow; |
| | | |
| | | |
| | | #region 初始化方法 |
| | |
| | | { |
| | | BattleDebug.LogError("缺少SkeletonGraphic组件!"); |
| | | } |
| | | |
| | | |
| | | illusionShadow = _skeletonAnimation.gameObject.AddMissingComponent<SkeletonIllusionShadow>(); |
| | | } |
| | | |
| | | public virtual void Release() |
| | |
| | | |
| | | public virtual void Run() |
| | | { |
| | | // #if UNITY_EDITOR |
| | | // List<int> removeIndex = new List<int>(); |
| | | // #endif |
| | | // #if UNITY_EDITOR |
| | | // List<int> removeIndex = new List<int>(); |
| | | // #endif |
| | | for (int i = runActionList.Count - 1; i >= 0; i--) |
| | | { |
| | | // #if UNITY_EDITOR |
| | | // try |
| | | // { |
| | | // #endif |
| | | runActionList[i]?.Invoke(); |
| | | // #if UNITY_EDITOR |
| | | // } |
| | | // catch (System.Exception ex) |
| | | // { |
| | | // removeIndex.Add(i); |
| | | // BattleDebug.LogError($"执行RunAction时发生异常: {ex.Message}\n{ex.StackTrace}"); |
| | | // } |
| | | // #endif |
| | | // #if UNITY_EDITOR |
| | | // try |
| | | // { |
| | | // #endif |
| | | runActionList[i]?.Invoke(); |
| | | // #if UNITY_EDITOR |
| | | // } |
| | | // catch (System.Exception ex) |
| | | // { |
| | | // removeIndex.Add(i); |
| | | // BattleDebug.LogError($"执行RunAction时发生异常: {ex.Message}\n{ex.StackTrace}"); |
| | | // } |
| | | // #endif |
| | | } |
| | | |
| | | // #if UNITY_EDITOR |
| | | // // 移除失败的Action |
| | | // for (int i = 0; i < removeIndex.Count; i++) |
| | | // { |
| | | // runActionList.RemoveAt(removeIndex[i]); |
| | | // } |
| | | // #endif |
| | | // #if UNITY_EDITOR |
| | | // // 移除失败的Action |
| | | // for (int i = 0; i < removeIndex.Count; i++) |
| | | // { |
| | | // runActionList.RemoveAt(removeIndex[i]); |
| | | // } |
| | | // #endif |
| | | illusionShadow.Run(); |
| | | } |
| | | |
| | | public virtual void Pause() |
| | |
| | | skeletonAnimation.timeScale = ratio; |
| | | } |
| | | |
| | | public void ShowIllusionShadow(bool v) |
| | | { |
| | | illusionShadow.SetSkeletonAnimation(skeletonAnimation); |
| | | illusionShadow.Show(v); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |