125 战斗 角色身上的buff特效要绑人物中心点(hit挂载点上),否者人物跳跃动作时会特效会脱离,特效配置上有一个绑定骨骼字段,需支持hit点(Buff特效)
3个文件已修改
44 ■■■■■ 已修改文件
Main/Component/UI/Effect/BattleEffectPlayer.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Buff/BattleObjectBuffMgr.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Motion/MotionBase.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Component/UI/Effect/BattleEffectPlayer.cs
@@ -30,6 +30,8 @@
        }
    }
    public bool isBindBone = false;
    public bool isRedCamp = true;
    public EffectConfig effectConfig;
@@ -625,4 +627,30 @@
            animator.speed = speedRate;
        }
    }
    public void BindBone(SkeletonAnimation skeletonAnim, string v)
    {
        Bone bone = skeletonAnim.skeleton.FindBone(v);
        if (null == bone)
        {
             return;
        }
        isBindBone = true;
        BoneFollower boneFollower = gameObject.AddMissingComponent<BoneFollower>();
        boneFollower.boneName = v;
        boneFollower.skeletonRenderer = skeletonAnim;
        boneFollower.followBoneRotation = false;
        boneFollower.followXYPosition = true;
        boneFollower.followZPosition = false;
        boneFollower.followLocalScale = false;
        boneFollower.followParentWorldScale = false;
        boneFollower.followSkeletonFlip = false;
        boneFollower.Initialize();
        boneFollower.LateUpdate();
    }
}
Main/System/Battle/Buff/BattleObjectBuffMgr.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Spine.Unity;
using UnityEngine;
@@ -31,6 +32,10 @@
            BattleEffectPlayer effectPlayer = kv.Value.Key;
            if (null != effectPlayer)
            {
                if (effectPlayer.isBindBone)
                {
                    continue;
                }
                effectPlayer.transform.position = battleObject.heroRectTrans.position;
                var effectPos = effectPlayer.effectConfig.effectPos;
                if (null != effectPos && effectPos.Length >= 2)
@@ -113,14 +118,14 @@
            return;
        }
        bool isNew = false;
        // bool isNew = false;
        if (buffDataDict.ContainsKey(vNetData.BuffID))
        {
            buffDataDict[vNetData.BuffID] = vNetData;
        }
        else
        {
            isNew = true;
            // isNew = true;
            buffDataDict.Add(vNetData.BuffID, vNetData);
        }
@@ -138,6 +143,11 @@
                    else
                    {
                        BattleEffectPlayer effect = battleObject.battleField.battleEffectMgr.PlayEffect(battleObject, skillConfig.BuffEffect, battleObject.heroRectTrans, battleObject.Camp);
                        BoneFollower boneFollower = effect.AddMissingComponent<BoneFollower>();
                        effect.BindBone(battleObject.motionBase.skeletonAnim, "hit");
                        HashSet<uint> buffIdSet = new HashSet<uint>();
                        buffIdSet.Add(vNetData.BuffID);
                        buffEffectDict.Add(skillConfig.BuffEffect, new KeyValuePair<BattleEffectPlayer, HashSet<uint>>(effect, buffIdSet));
Main/System/Battle/Motion/MotionBase.cs
@@ -18,7 +18,7 @@
    public Action OnHitAnimationComplete;
    private List<Action> runningActions = new List<Action>();
    protected SkeletonAnimation skeletonAnim;
    public SkeletonAnimation skeletonAnim;
    protected Spine.AnimationState animState;
    protected Spine.Skeleton skeleton;
    protected float defaultMixDuration = 0f;