yyl
4 天以前 7c1079d84f0552002699f29cc90b0da7bacba899
125 战斗 连击 追击 反击的飘字
5个文件已修改
70 ■■■■ 已修改文件
Main/System/Battle/BattleConst.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleUtility.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Skill/SkillBase.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/UIComp/BattleHeroInfoBar.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/UIComp/BattleTips.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleConst.cs
@@ -30,6 +30,13 @@
    public const int BattleTotalRecoverType = 100002; // 总治疗类型ID
    public const int BattleComboAttack = 100003; // 连击
    public const int BattleCounterAttack = 100004; // 反击
    public const int BattleChaseAttack = 100005; // 追击
    public const int BattleStun = 100006; // 击晕
    //  1000~10000之间的战斗层级
    //  需要考虑根据UI 特效 战斗角色三方的层级关系
@@ -56,7 +63,7 @@
    {
        get
        {
            return  UnactiveHeroBackSortingOrder - 1;
            return UnactiveHeroBackSortingOrder - 1;
        }
    }
@@ -157,7 +164,7 @@
    {
        get
        {
            return ActiveHeroSortingOrder + 2;
            return ActiveHeroSortingOrder + 10;
        }
    }
@@ -167,7 +174,7 @@
    {
        get
        {
            return ActiveHeroFrontSortingOrder - 1;
            return ActiveHeroFrontSortingOrder - 5;
        }
    }
Main/System/Battle/BattleUtility.cs
@@ -127,7 +127,7 @@
        return result;
    }
    static string ConvertToArtFont(DamageNumConfig config, float _num)
    public static string ConvertToArtFont(DamageNumConfig config, float _num)
    {
        var stringBuild = new System.Text.StringBuilder();
Main/System/Battle/Skill/SkillBase.cs
@@ -84,6 +84,29 @@
        TeamHero teamHero = caster.teamHero;
        EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero);
        if (caster != null)
        {
            // 战斗类型 0-常规;1-连击;2-反击;3-追击;4-子技能;5-被动触发的
            DamageNumConfig hintConfig = null;
            if (tagUseSkillAttack.BattleType == 1)
            {
                hintConfig = DamageNumConfig.Get(BattleConst.BattleComboAttack);
            }
            else if (tagUseSkillAttack.BattleType == 2)
            {
                hintConfig = DamageNumConfig.Get(BattleConst.BattleCounterAttack);
            }
            else if (tagUseSkillAttack.BattleType == 3)
            {
                hintConfig = DamageNumConfig.Get(BattleConst.BattleChaseAttack);
            }
            if (hintConfig != null)
            {
                caster.heroInfoBar.ShowTips(((char)hintConfig.prefix).ToString(), true);
            }
        }
        // 高亮所有本次技能相关的目标
        HighLightAllTargets();
Main/System/Battle/UIComp/BattleHeroInfoBar.cs
@@ -20,7 +20,7 @@
    [SerializeField] public List<BattleBuffCell> buffCells = new List<BattleBuffCell>();
    protected List<string> messages = new List<string>();
    protected List<KeyValuePair<string, bool>> messages = new List<KeyValuePair<string, bool>>();
    public BasicHeroInfoContainer heroInfoContainer;
 
@@ -80,9 +80,9 @@
        }
        tipsList.Clear();
    }
    public void ShowTips(string message)
    public void ShowTips(string message, bool useArtText = false)
    {
        messages.Add(message);
        messages.Add(new KeyValuePair<string, bool>(message, useArtText));
    }
    public void SetActive(bool active)
@@ -90,7 +90,7 @@
        gameObject.SetActive(active);
    }
    public void PopUpTipsDirectly(string message)
    public void PopUpTipsDirectly(string message, bool useArtText = false)
    {
        GameObject prefab = textTips.gameObject;
@@ -98,7 +98,7 @@
        BattleTips tips = go.GetComponent<BattleTips>();
        tips.SetText(message);
        tips.SetText(message, useArtText);
        tips.OnFinish = () =>
        {
@@ -168,10 +168,10 @@
        if (messages.Count > 0 && timer >= PopUpInterval)
        {
            // 播放飘字
            string message = messages[0];
            KeyValuePair<string, bool> message = messages[0];
            messages.RemoveAt(0);
            PopUpTipsDirectly(message);
            PopUpTipsDirectly(message.Key, message.Value);
            timer = 0f;
        }
Main/System/Battle/UIComp/BattleTips.cs
@@ -14,14 +14,28 @@
    public Text tipText;
    public Text artText;
    public Action OnFinish;
    public void SetText(string text)
    public void SetText(string text, bool useArtText = false)
    {
        tipText.text = text;
        rectTransform.anchoredPosition = Vector2.zero;
        timer = 0f;
        gameObject.SetActive(true);
        if (useArtText)
        {
            artText.text = text;
            tipText.gameObject.SetActive(false);
            artText.gameObject.SetActive(true);
        }
        else
        {
            tipText.text = text;
            artText.gameObject.SetActive(false);
            tipText.gameObject.SetActive(true);
        }
    }