| | |
| | | protected SkeletonAnimation spineComp; |
| | | protected Spine.AnimationState spineAnimationState; |
| | | |
| | | protected int heroSetedSortingOrder; |
| | | |
| | | public GameObjectPoolManager.GameObjectPool pool; |
| | | |
| | | public Action onComplete; |
| | |
| | | //隐藏,会有静态显示问题 |
| | | spineComp.enabled = false; |
| | | } |
| | | |
| | | ApplySortingOrder(); |
| | | } |
| | | |
| | | |
| | |
| | | onComplete?.Invoke(); |
| | | } |
| | | |
| | | public void SetSortingOrder(int _heroSetedSortingOrder) |
| | | public Func<bool> funcIsHeroFront; |
| | | |
| | | public void SetSortingOrder(Func<bool> _isHeroFrontCallback) |
| | | { |
| | | heroSetedSortingOrder = _heroSetedSortingOrder; |
| | | funcIsHeroFront = _isHeroFrontCallback; |
| | | |
| | | int so = heroSetedSortingOrder; |
| | | ApplySortingOrder(); |
| | | } |
| | | |
| | | if (null != blocker && effectConfig != null) |
| | | |
| | | public void ApplySortingOrder() |
| | | { |
| | | if (null != blocker && effectConfig != null && funcIsHeroFront != null) |
| | | { |
| | | if (BattleConst.UnactiveHeroSortingOrder == heroSetedSortingOrder) |
| | | { |
| | | so = effectConfig.frontBack == 1 ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder; |
| | | } |
| | | else |
| | | { |
| | | so = effectConfig.frontBack == 1 ? BattleConst.ActiveHeroFrontSortingOrder : BattleConst.ActiveHeroBackSortingOrder; |
| | | } |
| | | bool isEffectFront = effectConfig.frontBack == 1; |
| | | |
| | | blocker.SetSortingOrder(so); |
| | | bool isHeroFront = funcIsHeroFront(); |
| | | |
| | | int finalSortingOrder = isHeroFront ? |
| | | (isEffectFront ? BattleConst.ActiveHeroActionSortingOrder : BattleConst.ActiveHeroBackSortingOrder) : (isEffectFront ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder); |
| | | |
| | | |
| | | blocker.SetSortingOrder(finalSortingOrder); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | blocker.onSortingChanged = OnSortingChanged; |
| | | |
| | | if (0 != heroSetedSortingOrder) |
| | | { |
| | | if (BattleConst.UnactiveHeroSortingOrder == heroSetedSortingOrder) |
| | | { |
| | | heroSetedSortingOrder = effectConfig.frontBack == 1 ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder; |
| | | } |
| | | else |
| | | { |
| | | heroSetedSortingOrder = effectConfig.frontBack == 1 ? BattleConst.ActiveHeroFrontSortingOrder : BattleConst.ActiveHeroBackSortingOrder; |
| | | } |
| | | |
| | | blocker.SetSortingOrder(heroSetedSortingOrder); |
| | | } |
| | | ApplySortingOrder(); |
| | | |
| | | spineComp.enabled = true; |
| | | |