| | |
| | | |
| | | bool isHeroFront = funcIsHeroFront(); |
| | | |
| | | int finalSortingOrder = isHeroFront ? |
| | | (isEffectFront ? BattleConst.ActiveHeroActionSortingOrder + 1 : BattleConst.ActiveHeroBackSortingOrder) : (isEffectFront ? BattleConst.UnactiveHeroFrontSortingOrder : BattleConst.UnactiveHeroBackSortingOrder); |
| | | int baseSortingOrder = isHeroFront ? BattleConst.SkillMaskOrder : BattleConst.BattleBackgroundOrder - BattleConst.BattleFrontHeroEffect - 1; |
| | | |
| | | // 区分是否在特效前面 还要再区分是否在UI前面 isBindBone |
| | | int dynamicOffset = isBindBone |
| | | ? BattleConst.BattleFrontHeroBehindUIEffect : (isEffectFront ? BattleConst.BattleFrontHeroEffect : BattleConst.BattleBehindHeroEffect); |
| | | |
| | | int finalSortingOrder = baseSortingOrder + dynamicOffset; |
| | | |
| | | |
| | | blocker.SetSortingOrder(finalSortingOrder); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public void BindBone(SkeletonAnimation skeletonAnim, string v) |
| | | public void BindBone(BattleObject battleObject, string v) |
| | | { |
| | | if (battleObject == null || battleObject.motionBase == null || battleObject.motionBase.skeletonAnim == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var skeletonAnim = battleObject.motionBase.skeletonAnim; |
| | | |
| | | Bone bone = skeletonAnim.skeleton.FindBone(v); |
| | | isBindBone = false; |
| | | followedBone = null; |
| | |
| | | isBindBone = true; |
| | | followedBone = bone; |
| | | |
| | | ApplySortingOrder(); |
| | | |
| | | BoneFollower boneFollower = gameObject.AddMissingComponent<BoneFollower>(); |
| | | boneFollower.boneName = v; |
| | | boneFollower.skeletonRenderer = skeletonAnim; |