hch
昨天 a7bbe4767fb5ec5de271290c4ccea710eb3dd191
Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
4个文件已修改
155 ■■■■■ 已修改文件
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/CustomServerPack/CustomHB427_tagSCUseSkill.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleObject/BattleObjectFactory.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Skill/SkillBase.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class CustomHB426CombinePack : GameNetPackBasic
@@ -141,15 +142,18 @@
                    //  处理技能之间的链接关系
                    if (skillPack.RelatedSkillID > 0)
                    {
                        skillDict.TryGetValue(skillPack.RelatedSkillID, out var parentSkill);
                        // 如果是被 HB426_tagSCTurnFightTag 包裹的第一个技能包 并且前面没有CustomHB426CombinePack
                        // 则需要把CustomHB426CombinePack加入skillPack的subSkillCombinePackList里
                        // 同时 需要把indexDict里删掉对应的subSkillCombinePackList
                        // subSkillList删掉对应skillPack,但是skillPack的parentSkill不变
                        skillDict.TryGetValue(skillPack.RelatedSkillID, out var parentSkill);
                        if (parentSkill != null && skillPack.BattleType == 4)//4=子技能
                        {
                            parentSkill.subSkillList.Add(skillPack);
                            skillPack.parentSkill = parentSkill;
                        }
                        indexDict.Add(i, pack);
                    }
                    else
                    {
@@ -172,6 +176,10 @@
            }
        }
        // 如果是被 HB426_tagSCTurnFightTag 包裹的第一个技能包 并且前面没有CustomHB426CombinePack
        // 翻译一下就是 如果CombinePack里的主体Skill包 skillPack.RelatedSkillID > 0
        //  嵌套包内的包合并
        foreach (var combinePack in combineDict.Values)
@@ -182,11 +190,75 @@
                {
                    indexDict.Remove(i);
                    combinePack.AddPack(pack);
                    if (pack is CustomHB426CombinePack)
                    if (pack is CustomHB426CombinePack cbPack)
                    {
                        //  如果是嵌套的包 加入之后 调整i
                        i = (pack as CustomHB426CombinePack).toIndex;
                        i = cbPack.toIndex;
                    }
                }
            }
        }
        for (int i = 0; i < b421SeriesPackList.Count; i++)
        {
            if (indexDict.TryGetValue(i, out var pack))
            {
                if (pack is CustomHB426CombinePack cbPack)
                {
                    HB427_tagSCUseSkill skillPack = cbPack.GetMainHB427SkillPack();
                    if (null == skillPack)
                    {
                        continue;
                    }
                    //  如果是子技能
                    if (skillPack.isSubSkill)
                    {
                        //  让别人来处理
                        continue;
                    }
                    else
                    {
                        //  处理子技能
                        if (skillPack.subSkillList.Count > 0)
                        {
                            var parentSkill = skillPack;
                            List<HB427_tagSCUseSkill> toRemoveSubSkills = new List<HB427_tagSCUseSkill>();
                            foreach (var subSkill in parentSkill.subSkillList)
                            {
                                CustomHB426CombinePack innerCBPack = null;
                                if (cbPack.IsInnerCBPackContainsSkill(subSkill, ref innerCBPack))
                                {
                                    if (cbPack.GetMainHB427SkillPack() == subSkill)
                                    {
                                        parentSkill.subSkillList.Remove(subSkill);
                                        Debug.LogError("子技能不能是主技能: " + subSkill.SkillID);
                                        continue;
                                    }
                                    subSkill.parentCombinePack = innerCBPack;
                                    cbPack.packList.Remove(innerCBPack);
                                    toRemoveSubSkills.Add(subSkill);
                                    parentSkill.subSkillCombinePackList.Add(innerCBPack);
                                    indexDict.Remove(innerCBPack.fromIndex);
                                }
                            }
                            foreach (var subSkill in toRemoveSubSkills)
                            {
                                parentSkill.subSkillList.Remove(subSkill);
                            }
                        }
                        else
                        {
                            // 主技能没有子技能 直接跳过
                            continue;
                        }
                    }
                }
                else if (pack is HB427_tagSCUseSkill skillPack)
                {
                    Debug.LogError("落单的技能");
                }
            }
        }
@@ -200,15 +272,6 @@
            if (indexDict.TryGetValue(i, out var pack))
            {
                newPackList.Add(pack);
                if (pack is CustomHB426CombinePack)
                {
                    var cbpack = pack as CustomHB426CombinePack;
                    // temp += "pack type is " + pack.GetType().Name + " tag is " + cbpack.startTag.Tag + "\n";
                }
                else
                {
                    // temp += "pack type is " + pack.GetType().Name + "\n";
                }
            }
        }
@@ -219,6 +282,40 @@
        return newPackList;
    }
    public HB427_tagSCUseSkill GetMainHB427SkillPack()
    {
        for (int i = 0; i < packList.Count; i++)
        {
            var pack = packList[i];
            if (pack is HB427_tagSCUseSkill skillPack)
            {
                return skillPack;
            }
            else if (pack is CustomHB426CombinePack)
            {
                return null;
            }
        }
        return null;
    }
    public bool IsInnerCBPackContainsSkill(HB427_tagSCUseSkill skill, ref CustomHB426CombinePack innerCBPack)
    {
        for (int i = 0; i < packList.Count; i++)
        {
            var pack = packList[i];
            if (pack is CustomHB426CombinePack cbPack)
            {
                if (cbPack.packList.Contains(skill))
                {
                    innerCBPack = cbPack;
                    return true;
                }
            }
        }
        return false;
    }
    public void Distribute()
    {
        BattleField battleField = BattleManager.Instance.GetBattleField(guid);
Main/Core/NetworkPackage/CustomServerPack/CustomHB427_tagSCUseSkill.cs
@@ -16,12 +16,24 @@
        set;
    } = new HashSet<HB427_tagSCUseSkill>();
    public HashSet<CustomHB426CombinePack> subSkillCombinePackList
    {
        get;
        set;
    } = new HashSet<CustomHB426CombinePack>();
    public HB427_tagSCUseSkill parentSkill
    {
        get;
        set;
    } = null;
    public CustomHB426CombinePack parentCombinePack
    {
        get;
        set;
    } = null;
    public bool isSubSkill
    {
        get
Main/System/Battle/BattleObject/BattleObjectFactory.cs
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System;
using UnityEngine;
@@ -50,9 +49,19 @@
        float finalScaleRate = modelScaleRate * teamHero.modelScale;
        skeletonAnimation.skeletonDataAsset = skeletonDataAsset;
        skeletonAnimation.initialSkinName = skinCfg.InitialSkinName;
        skeletonAnimation.skeletonDataAsset = skeletonDataAsset;
        skeletonAnimation.Initialize(true);
        // 初始化完成后设置皮肤
        if (!string.IsNullOrEmpty(skinCfg.InitialSkinName))
        {
            var skeleton = skeletonAnimation.Skeleton;
            skeleton.SetSkin(skinCfg.InitialSkinName);
            skeleton.SetSlotsToSetupPose();
            skeletonAnimation.Update(0);
        }
        realGO.name = battleObject.ObjID.ToString();
        realGO.transform.localScale = new Vector3(finalScaleRate, finalScaleRate, finalScaleRate);
        RectTransform rectTrans = realGO.GetComponent<RectTransform>();
Main/System/Battle/Skill/SkillBase.cs
@@ -348,6 +348,13 @@
            otherSkillActionList.Add(recordAction);
            battleField.recordPlayer.ImmediatelyPlay(recordAction);
        }
        foreach (var subCombinePack in tagUseSkillAttack.subSkillCombinePackList)
        {
            SkillRecordAction recordAction = CustomHB426CombinePack.CreateSkillAction(battleField.guid, subCombinePack.packList);
            otherSkillActionList.Add(recordAction);
            battleField.recordPlayer.ImmediatelyPlay(recordAction);
        }
        isPlay = true;
    }