少年修仙传客户端代码仓库
Client_PangDeRong
2018-08-18 06a5444e67bf745a0cb5de51adcfa78de36707f4
[1885]处理神兽数据
2 文件已重命名
10个文件已修改
1 文件已复制
1个文件已添加
379 ■■■■■ 已修改文件
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMDogzEquipItem.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMDogzEquipItem.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzBattleStateChange.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzBattleStateChange.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzEquipPlus.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzEquipPlus.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3C0_tagMCDogzInfo.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3C1_tagMCDogzHelpbattleState.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzActiveWin.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzDetailBehaviour.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzDetailsWin.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzEquip.cs 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzModel.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dogz/DogzPackWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMDogzEquipItem.cs
File was renamed from Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMRuneCompound.cs
@@ -3,11 +3,11 @@
// A5 C0 神兽穿戴装备 #tagCMDogzEquipItem
public class CA5C0_tagCMRuneCompound : GameNetPackBasic {
public class CA5C0_tagCMDogzEquipItem : GameNetPackBasic {
    public byte DogzID;    // 神兽ID
    public byte EquipIndex;    //神兽装备所在神兽背包索引
    public CA5C0_tagCMRuneCompound () {
    public CA5C0_tagCMDogzEquipItem () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA5C0;
    }
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMDogzEquipItem.cs.meta
copy from Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMRuneCompound.cs.meta copy to Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMDogzEquipItem.cs.meta
File was copied from Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMRuneCompound.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: b00a5364802efe042ab660ccf8ad18c6
timeCreated: 1534495463
guid: 23a1593c938d2a54aaf891bee0cc83a6
timeCreated: 1534573006
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzBattleStateChange.cs
@@ -1,24 +1,45 @@
using UnityEngine;
using System.Collections;
// A5 C4 神兽装备强化 #tagCMDogzEquipPlus
public class CA5C4_tagCMDogzBattleStateChange : GameNetPackBasic {
    public byte EquipIndex;    //神兽装备背包中索引
    public byte IndexCount;    //材料所在神兽物品背包索引的数量
    public  byte[] IndexList;    //材料所在神兽物品背包索引列表
    public byte IsDouble;    //是否双倍强化
    public CA5C4_tagCMDogzBattleStateChange () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA5C4;
    }
    public override void WriteToBytes () {
        WriteBytes (EquipIndex, NetDataType.BYTE);
        WriteBytes (IndexCount, NetDataType.BYTE);
        WriteBytes (IndexList, NetDataType.BYTE, IndexCount);
        WriteBytes (IsDouble, NetDataType.BYTE);
    }
}
// A5 C4 神兽装备强化 #tagCMDogzEquipPlus
public class CA5C4_tagCMDogzBattleStateChange : GameNetPackBasic {
    public byte EquipIndex;    //神兽装备背包中索引
    public byte IndexCount;    //材料所在神兽物品背包索引的数量
    public  byte[] IndexList;    //材料所在神兽物品背包索引列表
    public byte IsDouble;    //是否双倍强化
    public CA5C4_tagCMDogzBattleStateChange () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA5C4;
    }
    public override void WriteToBytes () {
        WriteBytes (EquipIndex, NetDataType.BYTE);
        WriteBytes (IndexCount, NetDataType.BYTE);
        WriteBytes (IndexList, NetDataType.BYTE, IndexCount);
        WriteBytes (IsDouble, NetDataType.BYTE);
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzBattleStateChange.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 06d0a968835825d4682ef91adddf7aca
timeCreated: 1534495572
timeCreated: 1534573684
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzEquipPlus.cs
New file
@@ -0,0 +1,45 @@
using UnityEngine;
using System.Collections;
// A5 C4 神兽装备强化 #tagCMDogzEquipPlus
public class CA5C4_tagCMDogzEquipPlus : GameNetPackBasic {
    public byte EquipIndex;    //神兽装备背包中索引
    public byte IndexCount;    //材料所在神兽物品背包索引的数量
    public  byte[] IndexList;    //材料所在神兽物品背包索引列表
    public byte IsDouble;    //是否双倍强化
    public CA5C4_tagCMDogzEquipPlus () {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA5C4;
    }
    public override void WriteToBytes () {
        WriteBytes (EquipIndex, NetDataType.BYTE);
        WriteBytes (IndexCount, NetDataType.BYTE);
        WriteBytes (IndexList, NetDataType.BYTE, IndexCount);
        WriteBytes (IsDouble, NetDataType.BYTE);
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C4_tagCMDogzEquipPlus.cs.meta
File was renamed from Core/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA5C0_tagCMRuneCompound.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: b00a5364802efe042ab660ccf8ad18c6
timeCreated: 1534495463
guid: 492661260e65b124d9ae25fc29018a94
timeCreated: 1534573007
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3C0_tagMCDogzInfo.cs
@@ -1,11 +1,21 @@
using UnityEngine;
using System.Collections;
using Snxxz.UI;
// A3 C0 神兽信息 #tagMCDogzInfo
public class DTCA3C0_tagMCDogzInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3C0_tagMCDogzInfo vNetData = vNetPack as HA3C0_tagMCDogzInfo;
    }
}
// A3 C0 神兽信息 #tagMCDogzInfo
public class DTCA3C0_tagMCDogzInfo : DtcBasic {
    DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3C0_tagMCDogzInfo vNetData = vNetPack as HA3C0_tagMCDogzInfo;
        dogzModel.SetServerAddAssistDogzCnt(vNetData);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3C1_tagMCDogzHelpbattleState.cs
@@ -1,11 +1,21 @@
using UnityEngine;
using System.Collections;
using Snxxz.UI;
// A3 C1 神兽助战状态刷新 #tagMCDogzHelpbattleState
public class DTCA3C1_tagMCDogzHelpbattleState : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3C1_tagMCDogzHelpbattleState vNetData = vNetPack as HA3C1_tagMCDogzHelpbattleState;
    }
}
// A3 C1 神兽助战状态刷新 #tagMCDogzHelpbattleState
public class DTCA3C1_tagMCDogzHelpbattleState : DtcBasic {
    DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3C1_tagMCDogzHelpbattleState vNetData = vNetPack as HA3C1_tagMCDogzHelpbattleState;
        dogzModel.SetServerAssistDogzState(vNetData);
    }
}
System/Dogz/DogzActiveWin.cs
@@ -34,6 +34,9 @@
                return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DogzModel>());
            }
        }
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        #region Built-in
        protected override void BindController()
        {
@@ -63,6 +66,8 @@
            UpdateDogzAssistCnt();
            model.UpdateSelectDogzEvent += UpdateSelectDogzEvent;
            model.UpdateAssistDogzEvent += UpdateDogzAssistCnt;
            model.RefreshDogzEquipAct += RefreshDogzEquipEvent;
        }
@@ -72,6 +77,9 @@
        protected override void OnPreClose()
        {
            model.UpdateSelectDogzEvent -= UpdateSelectDogzEvent;
            model.UpdateAssistDogzEvent -= UpdateDogzAssistCnt;
            model.RefreshDogzEquipAct -= RefreshDogzEquipEvent;
        }
        protected override void OnAfterClose()
@@ -131,6 +139,14 @@
                }
            }
        }
        private void RefreshDogzEquipEvent(int dogzId)
        {
            if (dogzId != model.presentSelectDogz) return;
            UpdateDogzEquip();
        }
        private void UpdateDogzEquip()
        {
            var _dogzCfg = ConfigManager.Instance.GetTemplate<DogzConfig>(model.presentSelectDogz);
@@ -144,7 +160,7 @@
                m_DogzEquips[i].gameObject.SetActive(_equiped);
                if (_equiped)
                {
                    m_DogzEquips[i].Display(_data.itemId);
                    m_DogzEquips[i].Display(_data);
                }
            }
        }
System/Dogz/DogzDetailBehaviour.cs
@@ -43,53 +43,53 @@
            });
        }
        public void Display(DogzEquipData data)
        public void Display(ItemModel data)
        {
            m_DogzEquip.Display(data.ItemId);
            var config = ConfigManager.Instance.GetTemplate<ItemConfig>(data.ItemId);
            if (config != null)
            {
                m_ItemNameTxt.text = config.ItemName;
                m_ItemNameTxt.color = UIHelper.GetUIColor(config.ItemColor);
            }
            m_ContainerBaseProp.gameObject.SetActive(data.basePropertyDict != null);
            if (data.basePropertyDict != null)
            {
                var index = 0;
                foreach (var _key in data.basePropertyDict.Keys)
                {
                    if (index < m_BasePropertys.Length)
                    {
                        var propertyConfig = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_key);
                        m_BasePropertys[index].gameObject.SetActive(true);
                        m_BasePropertys[index].Display(_key, data.basePropertyDict[_key]);
                    }
                    index++;
                }
                for (int i = index; i < m_BasePropertys.Length; i++)
                {
                    m_BasePropertys[i].gameObject.SetActive(false);
                }
            }
            m_ContainerSpecialProp.gameObject.SetActive(data.specialPropertyDict != null);
            if (data.specialPropertyDict != null)
            {
                var index = 0;
                foreach (var _key in data.specialPropertyDict.Keys)
                {
                    if (index < m_SpecialPropertys.Length)
                    {
                        var propertyConfig = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_key);
                        m_SpecialPropertys[index].gameObject.SetActive(true);
                        m_SpecialPropertys[index].Display(_key, data.specialPropertyDict[_key]);
                    }
                    index++;
                }
                for (int i = index; i < m_SpecialPropertys.Length; i++)
                {
                    m_SpecialPropertys[i].gameObject.SetActive(false);
                }
            }
            //m_DogzEquip.Display(data);
            //var config = ConfigManager.Instance.GetTemplate<ItemConfig>(data.itemId);
            //if (config != null)
            //{
            //    m_ItemNameTxt.text = config.ItemName;
            //    m_ItemNameTxt.color = UIHelper.GetUIColor(config.ItemColor);
            //}
            //m_ContainerBaseProp.gameObject.SetActive(data.basePropertyDict != null);
            //if (data.basePropertyDict != null)
            //{
            //    var index = 0;
            //    foreach (var _key in data.basePropertyDict.Keys)
            //    {
            //        if (index < m_BasePropertys.Length)
            //        {
            //            var propertyConfig = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_key);
            //            m_BasePropertys[index].gameObject.SetActive(true);
            //            m_BasePropertys[index].Display(_key, data.basePropertyDict[_key]);
            //        }
            //        index++;
            //    }
            //    for (int i = index; i < m_BasePropertys.Length; i++)
            //    {
            //        m_BasePropertys[i].gameObject.SetActive(false);
            //    }
            //}
            //m_ContainerSpecialProp.gameObject.SetActive(data.specialPropertyDict != null);
            //if (data.specialPropertyDict != null)
            //{
            //    var index = 0;
            //    foreach (var _key in data.specialPropertyDict.Keys)
            //    {
            //        if (index < m_SpecialPropertys.Length)
            //        {
            //            var propertyConfig = ConfigManager.Instance.GetTemplate<PlayerPropertyConfig>(_key);
            //            m_SpecialPropertys[index].gameObject.SetActive(true);
            //            m_SpecialPropertys[index].Display(_key, data.specialPropertyDict[_key]);
            //        }
            //        index++;
            //    }
            //    for (int i = index; i < m_SpecialPropertys.Length; i++)
            //    {
            //        m_SpecialPropertys[i].gameObject.SetActive(false);
            //    }
            //}
        }
        private void OnEnable()
System/Dogz/DogzDetailsWin.cs
@@ -49,9 +49,9 @@
        private void Display()
        {
            m_Compare.gameObject.SetActive(model.viewDetailCompare);
            m_Single.Display(model.viewDetailData);
            m_Single.gameObject.SetActive(true);
            //m_Compare.gameObject.SetActive(model.viewDetailCompare);
            //m_Single.Display(model.viewDetailData);
            //m_Single.gameObject.SetActive(true);
        }
        private void OnClose()
System/Dogz/DogzEquip.cs
@@ -9,68 +9,33 @@
{
    public class DogzEquip : MonoBehaviour
    {
        [SerializeField] Image m_EquipBG;
        [SerializeField] Image m_EquipIcon;
        [SerializeField] List<Image> m_EquipStars;
        [SerializeField] Button m_ViewDetial;
        DogzModel model { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
        public int ItemId { get; private set; }
        public DogzEquipData equipData { get; private set; }
        private void Awake()
        [SerializeField] CommonItemBaisc itemBaisc;
        [SerializeField] Text strengLvTxt;
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        public void Display(ItemModel model)
        {
            if (m_ViewDetial != null)
            itemBaisc.Init(model);
            int strenLv = 0;
            if(model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus) != null)
            {
                m_ViewDetial.onClick.AddListener(ViewDetail);
                strenLv = model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus)[0];
            }
        }
        public void Display(int _itemId)
        {
            this.ItemId = _itemId;
            var _itemCfg = ConfigManager.Instance.GetTemplate<ItemConfig>(_itemId);
            if (_itemCfg != null)
            if (strenLv > 0)
            {
                DisplayEquipBG(_itemCfg.ItemColor);
                DisplayIcon(_itemId);
                DisplayStar(_itemCfg.StarLevel);
                strengLvTxt.gameObject.SetActive(true);
                strengLvTxt.text = StringUtility.Contact("+", strenLv);
            }
        }
        void DisplayEquipBG(int _itemColor)
        {
            if (m_EquipBG != null)
            else
            {
                m_EquipBG.SetItemBackGround(_itemColor);
                strengLvTxt.gameObject.SetActive(false);
            }
        }
        void DisplayIcon(int _itemId)
        {
            var config = ConfigManager.Instance.GetTemplate<ItemConfig>(_itemId);
            if (config != null && m_EquipIcon != null)
            itemBaisc.cellBtn.RemoveAllListeners();
            itemBaisc.cellBtn.AddListener(()=>
            {
                m_EquipIcon.SetSprite(config.IconKey);
            }
        }
        void DisplayStar(int _star)
        {
            if (m_EquipStars != null)
            {
                for (int i = 0; i < m_EquipStars.Count; i++)
                {
                    m_EquipStars[i].gameObject.SetActive(i < _star);
                }
            }
        }
        private void ViewDetail()
        {
            model.ViewDetail(ItemId);
                ItemAttrData attrData = new ItemAttrData(model.itemId,false,(ulong)model.itemInfo.ItemCount,model.itemInfo.ItemPlace,
                    model.itemInfo.IsBind,false,PackType.rptDogzEquip,model.itemInfo.ItemGUID);
                tipsModel.SetItemTipsModel(attrData);
            });
        }
    }
}
System/Dogz/DogzModel.cs
@@ -153,6 +153,10 @@
        {
            addAssistCnt = info.BuyHelpbattleCount;
            DogzAssistDefaultCnt += addAssistCnt;
            if (UpdateAssistDogzEvent != null)
            {
                UpdateAssistDogzEvent();
            }
        }
        public event Action UpdateAssistDogzEvent;
@@ -219,6 +223,7 @@
            }
        }
        public Action<int> RefreshDogzEquipAct;
        private void RefreshDogzEquipInfo(PackType type, int index, int id)
        {
            if (type != PackType.rptDogzEquip) return;
@@ -246,6 +251,11 @@
                        return;
                    }
                }
            }
            if(RefreshDogzEquipAct != null)
            {
                RefreshDogzEquipAct(dogzId);
            }
        }
@@ -301,7 +311,7 @@
        public void SendPutOnEquip(int dogzId,int index)
        {
            CA5C0_tagCMRuneCompound dogzPutOn = new CA5C0_tagCMRuneCompound();
            CA5C0_tagCMDogzEquipItem dogzPutOn = new CA5C0_tagCMDogzEquipItem();
            dogzPutOn.DogzID = (byte)dogzId;
            dogzPutOn.EquipIndex = (byte)index;
            GameNetSystem.Instance.SendInfo(dogzPutOn);
@@ -331,7 +341,7 @@
        public void SendDogzEquipStrength(int index,List<int>indexlist,int isDouble)
        {
            CA5C4_tagCMDogzBattleStateChange dogzStren = new CA5C4_tagCMDogzBattleStateChange();
            CA5C4_tagCMDogzEquipPlus dogzStren = new CA5C4_tagCMDogzEquipPlus();
            dogzStren.EquipIndex = (byte)index;
            dogzStren.IndexCount = (byte)indexlist.Count;
            byte[] indexByte = new byte[indexlist.Count];
System/Dogz/DogzPackWin.cs
@@ -90,7 +90,7 @@
                m_DogzEquips[i].gameObject.SetActive(_equiped);
                if (_equiped)
                {
                    m_DogzEquips[i].Display(_data.itemId);
                    m_DogzEquips[i].Display(_data);
                }
                else
                {