少年修仙传客户端代码仓库
client_Zxw
2019-03-11 6c168c5a3d19c0dd97aadd26e5dc5a3a9cbd1436
3335 装备强化
12个文件已添加
2个文件已修改
536 ■■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3B3_tagMCEquipPartPlusInfo.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3B3_tagMCEquipPartPlusInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3B3_tagMCEquipPartPlusInfo.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA3_Function/HA3B3_tagMCEquipPartPlusInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipFrameWin.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthHeadBehaviour.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthHeadBehaviour.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthModel.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthSelectBehaviour.cs 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthSelectBehaviour.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthWin.cs 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/EquipGem/EquipStrengthWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -140,7 +140,7 @@
        Register(typeof(HA31D_tagMCGodWeaponLVList), typeof(DTCA31D_tagMCGodWeaponLVList));
        Register(typeof(H03F0_tagPyFakePack), typeof(DTC03F0_tagPyFakePack));
        Register(typeof(H1801_tagGameServerGeneralPack), typeof(DTC1801_tagGameServerGeneralPack));
        Register(typeof(HA3B3_tagMCEquipPartStarLVInfo), typeof(DTCA3B3_tagMCEquipPartStarLVInfo));
        //Register(typeof(HA3B3_tagMCEquipPartStarLVInfo), typeof(DTCA3B3_tagMCEquipPartStarLVInfo));
        Register(typeof(H0310_tagRoleSkillChange), typeof(DTC0310_tagRoleSkillChange));
        Register(typeof(H0721_tagMakeItemAnswer), typeof(DTC0721_tagMakeItemAnswer));
        Register(typeof(HA9A1_tagGCQueryCompensationResult), typeof(DTCA9A1_tagGCQueryCompensationResult));
@@ -468,7 +468,7 @@
        Register(typeof(HB509_tagGCClearAuctionItemInfo), typeof(DTCB509_tagGCClearAuctionItemInfo));
        Register(typeof(HB510_tagGCBiddingItemInfo), typeof(DTCB510_tagGCBiddingItemInfo));
        #endregion
        Register(typeof(HA3B3_tagMCEquipPartPlusInfo), typeof(DTCA3B3_tagMCEquipPartPlusInfo));//装备强化
    }
    private static void Register(Type _pack, Type _business)
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3B3_tagMCEquipPartPlusInfo.cs
New file
@@ -0,0 +1,11 @@
using UnityEngine;
using System.Collections;
// A3 B3 装备部位强化信息 #tagMCEquipPartPlusInfo
public class DTCA3B3_tagMCEquipPartPlusInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA3B3_tagMCEquipPartPlusInfo vNetData = vNetPack as HA3B3_tagMCEquipPartPlusInfo;
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA3B3_tagMCEquipPartPlusInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bff935cf1b66fde498ac756ba6072d8f
timeCreated: 1552289936
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HA3_Function/HA3B3_tagMCEquipPartPlusInfo.cs
New file
@@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections;
// A3 B3 装备部位强化信息 #tagMCEquipPartPlusInfo
public class HA3B3_tagMCEquipPartPlusInfo : GameNetPackBasic {
    public byte Count;    // 信息个数
    public  tagMCEquipPartPlusLV[] InfoList;    // 信息列表
    public HA3B3_tagMCEquipPartPlusInfo () {
        _cmd = (ushort)0xA3B3;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out Count, vBytes, NetDataType.BYTE);
        InfoList = new tagMCEquipPartPlusLV[Count];
        for (int i = 0; i < Count; i ++) {
            InfoList[i] = new tagMCEquipPartPlusLV();
            TransBytes (out InfoList[i].PackType, vBytes, NetDataType.BYTE);
            TransBytes (out InfoList[i].EquipIndex, vBytes, NetDataType.BYTE);
            TransBytes (out InfoList[i].EquipPartStarLV, vBytes, NetDataType.WORD);
            TransBytes (out InfoList[i].Proficiency, vBytes, NetDataType.DWORD);
            TransBytes (out InfoList[i].EvolveLV, vBytes, NetDataType.BYTE);
        }
    }
    public struct tagMCEquipPartPlusLV {
        public byte PackType;
        public byte EquipIndex;
        public ushort EquipPartStarLV;
        public uint Proficiency;
        public byte EvolveLV;
    }
}
Core/NetworkPackage/ServerPack/HA3_Function/HA3B3_tagMCEquipPartPlusInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c11b073518011a54792e912e28ae7dea
timeCreated: 1552289936
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Equip/EquipFrameWin.cs
@@ -87,11 +87,14 @@
        {
            CloseSubWindows();
            WindowCenter.Instance.Open<EquipStarWin>();
            functionOrder = m_Star.order;
        }
        private void OpenStrengthenWin()
        {
            CloseSubWindows();
            CloseSubWindows();
            WindowCenter.Instance.Open<EquipStrengthWin>();
            functionOrder = m_Strengthen.order;
        }
        private void OpenInlayWin()
System/EquipGem/EquipStrengthHeadBehaviour.cs
New file
@@ -0,0 +1,69 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, March 11, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI {
    public class EquipStrengthHeadBehaviour: CellView
    {
        [SerializeField] Text m_EquipHeadName;
        [SerializeField] Transform m_UpArrow;
        [SerializeField] Transform m_DownArrow;
        [SerializeField] Transform m_ContainerSelect;
        [SerializeField] Button m_Select;
        [SerializeField] RedpointBehaviour m_Redpoint;
        EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
        int equipLevel = 0;
        public void Display(int level)
        {
            this.equipLevel = level;
            var equipSet = equipModel.GetEquipSet(level);
            if (equipSet != null)
            {
                var realmConfig = RealmConfig.Get(equipSet.realm);
                if (realmConfig != null)
                {
                    m_EquipHeadName.text = string.Format("{0}装备", realmConfig.Name);
                }
            }
            var select = strengthModel.SelectLevel == level;
            m_UpArrow.gameObject.SetActive(select);
            m_DownArrow.gameObject.SetActive(!select);
            m_ContainerSelect.gameObject.SetActive(select);
            m_Select.SetListener(OnSelect);
            Redpoint redpoint;
            m_Redpoint.redpointId = 0;
        }
        private void OnSelect()
        {
            if (strengthModel.SelectLevel == equipLevel)
            {
                strengthModel.SelectLevel = -1;
            }
            else
            {
                strengthModel.SelectLevel = equipLevel;
            }
        }
    }
}
System/EquipGem/EquipStrengthHeadBehaviour.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a2cb60c81a96d0d4da13e0543ef1fd64
timeCreated: 1552292183
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/EquipGem/EquipStrengthModel.cs
New file
@@ -0,0 +1,108 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, March 11, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Snxxz.UI;
using System;
//装备强化
public class EquipStrengthClass
{
    public int EquipIndex;//强化部位
    public int EquipPartStarLV;//等级
    public int Proficiency;//经验
    public int EvolveLV;//进化等级
    public int PackType;//强化类型
}
public class EquipStrengthModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
{
    Dictionary<int, EquipStrengthClass> EquipStrengthDic = new Dictionary<int, EquipStrengthClass>();
    public event Action EquipStrengthUpdate;//强化数据刷新
    public event Action SelectEquipRefresh;//二级页签刷新
    public event Action SelectLevelRefresh;//一级页签刷新
    private int selectLevel = 0;
    public int SelectLevel//装备类别
    {
        get { return selectLevel; }
        set
        {
            if (selectLevel != value)
            {
                selectLevel = value;
                if (SelectLevelRefresh != null)
                {
                    SelectLevelRefresh();
                }
            }
        }
    }
    private int selectEquipPlace = -1;//装备部位
    public int SelectEquipPlace//装备类别
    {
        get { return selectEquipPlace; }
        set
        {
            if (selectEquipPlace != value)
            {
                selectEquipPlace = value;
                if (SelectEquipRefresh != null)
                {
                    SelectEquipRefresh();
                }
            }
        }
    }
    public override void Init()
    {
    }
    public void OnBeforePlayerDataInitialize()
    {
    }
    public void OnPlayerLoginOk()
    {
    }
    public override void UnInit()
    {
    }
    public void GetEuipPartPlusInfo(HA3B3_tagMCEquipPartPlusInfo info)
    {
        for (int i = 0; i < info.Count; i++)
        {
            var equipPartPlus = info.InfoList[i];
            EquipStrengthClass equipStrength = new EquipStrengthClass();
            equipStrength.PackType = equipPartPlus.PackType;
            equipStrength.EquipIndex = equipPartPlus.EquipIndex;
            equipStrength.EquipPartStarLV = equipPartPlus.EquipPartStarLV;
            equipStrength.Proficiency = (int)equipPartPlus.Proficiency;
            equipStrength.EvolveLV = equipPartPlus.EvolveLV;
            if (EquipStrengthDic.ContainsKey(equipPartPlus.EquipIndex))
            {
                EquipStrengthDic[equipPartPlus.EquipIndex] = equipStrength;
            }
            else
            {
                EquipStrengthDic.Add(equipPartPlus.EquipIndex, equipStrength);
            }
        }
        if (EquipStrengthUpdate != null)
        {
            EquipStrengthUpdate();
        }
    }
}
System/EquipGem/EquipStrengthModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 82db210fd517eaa4c98ec367397d6558
timeCreated: 1552289828
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/EquipGem/EquipStrengthSelectBehaviour.cs
New file
@@ -0,0 +1,107 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, March 11, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI {
    public class EquipStrengthSelectBehaviour: CellView
    {
        [SerializeField] Transform m_ContainerEquip;
        [SerializeField] Transform m_ContainerUnEquip;
        [SerializeField] Text m_EquipPlaceName;
        [SerializeField] Transform m_ContainerSelect;
        [SerializeField] ItemCell m_Item;
        [SerializeField] Text m_ItemName;
        [SerializeField] TinyGem[] m_TinyGems;
        [SerializeField] Button m_Select;
        [SerializeField] RedpointBehaviour m_Redpoint;
        EquipGemModel model { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
        EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        EquipStarModel equipStarModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        int equipLevel = 0;
        int equipPlace = 0;
        string equipGuid = string.Empty;
        public void Display(int level, int place)
        {
            this.equipLevel = level;
            this.equipPlace = place;
            var equipSet = equipModel.GetEquipSet(equipLevel);
            equipGuid = equipSet.GetEquip(equipPlace);
            var equiped = !string.IsNullOrEmpty(equipGuid);
            m_ContainerEquip.gameObject.SetActive(equiped);
            m_ContainerUnEquip.gameObject.SetActive(!equiped);
            m_Select.SetListener(() => { model.selectEquipPlace = equipPlace; });
            if (equiped)
            {
                DisplayBase();
                DisplayGems();
                EquipGemRedpoint equipGemRedpoint;
                if (model.TryGetRedpoint(level, place, out equipGemRedpoint))
                {
                    m_Redpoint.redpointId = equipGemRedpoint.repoint.id;
                }
            }
            else
            {
                m_Redpoint.redpointId = 0;
                DisplayUnEquip();
            }
            m_ContainerSelect.gameObject.SetActive(model.selectEquipPlace == equipPlace);
        }
        void DisplayBase()
        {
            var item = packModel.GetItemByGuid(equipGuid);
            if (item != null)
            {
                m_Item.Init(item);
                m_ItemName.text = item.config.ItemName;
                m_ItemName.color = UIHelper.GetUIColor(item.config.ItemColor, true);
            }
        }
        void DisplayGems()
        {
            List<EquipGem> equipGems = null;
            model.TryGetEquipGems(equipLevel, equipPlace, out equipGems);
            for (int i = 0; i < m_TinyGems.Length; i++)
            {
                bool isOpen = model.IsEquipGemHoleOpen(equipLevel, equipPlace, i);
                m_TinyGems[i].gameObject.SetActive(isOpen);
                if (isOpen)
                {
                    var id = (equipGems != null && i < equipGems.Count) ? equipGems[i].id : 0;
                    m_TinyGems[i].Set(id);
                }
            }
        }
        void DisplayUnEquip()
        {
            if (GeneralDefine.equipPlaceNameDict.ContainsKey(equipPlace))
            {
                m_EquipPlaceName.text = Language.Get("L1076", GeneralDefine.equipPlaceNameDict[equipPlace]);
            }
        }
    }
}
System/EquipGem/EquipStrengthSelectBehaviour.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cba1c47f88dcbfc4a9c01fa2738ba5c8
timeCreated: 1552292412
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/EquipGem/EquipStrengthWin.cs
New file
@@ -0,0 +1,125 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, March 11, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class EquipStrengthWin : Window
    {
        [SerializeField] ScrollerController m_Controller;
        EquipStrengthModel strengthModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
        EquipGemModel model { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
        EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            m_Controller.OnRefreshCell += OnRefreshCell;
        }
        protected override void OnPreOpen()
        {
            DisplayEquips();
            strengthModel.SelectEquipRefresh += SelectEquipRefresh;
            strengthModel.SelectLevelRefresh += SelectLevelRefresh;
            strengthModel.EquipStrengthUpdate += EquipStrengthUpdate;
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            strengthModel.SelectEquipRefresh -= SelectEquipRefresh;
            strengthModel.SelectLevelRefresh -= SelectLevelRefresh;
            strengthModel.EquipStrengthUpdate -= EquipStrengthUpdate;
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void EquipStrengthUpdate()
        {
        }
        void DisplayEquips()
        {
            m_Controller.Refresh();
            var equipSets = equipModel.GetAllEquipSets();
            foreach (var level in equipSets)
            {
                var equipSet = equipModel.GetEquipSet(level);
                if (equipSet == null)
                {
                    continue;
                }
                if (equipSet.unLocked)
                {
                    var slotCount = model.GetUnlockEquipSlotCount(level);
                    if (slotCount > 0)
                    {
                        m_Controller.AddCell(ScrollerDataType.Header, level);
                        if (model.selectLevel == level)
                        {
                            var places = model.GetMosaicEquipPlaces();
                            foreach (var place in places)
                            {
                                if (equipSet.IsSlotUnLocked(place))
                                {
                                    m_Controller.AddCell(ScrollerDataType.Normal, level * 1000 + place);
                                }
                            }
                        }
                    }
                }
            }
            m_Controller.Restart();
        }
        private void SelectEquipRefresh()
        {
            m_Controller.m_Scorller.RefreshActiveCellViews();
        }
        private void SelectLevelRefresh()
        {
            DisplayEquips();
        }
        private void OnRefreshCell(ScrollerDataType type, CellView cell)
        {
            switch (type)
            {
                case ScrollerDataType.Header:
                    var equipGemHeadCell = cell as EquipStrengthHeadBehaviour;
                    equipGemHeadCell.Display(cell.index);
                    break;
                case ScrollerDataType.Normal:
                    var level = cell.index / 1000;
                    var place = cell.index % 1000;
                    var equipSelectCell = cell as EquipStrengthSelectBehaviour;
                    equipSelectCell.Display(level, place);
                    break;
            }
        }
    }
}
System/EquipGem/EquipStrengthWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 95006410bf30c1f42b5c45a2327adf0b
timeCreated: 1552289263
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: