少年修仙传客户端代码仓库
Client_PangDeRong
2019-01-21 f6fa7aed62fb6db0ef6bcf21c1e2eac9679ba051
5930 子 【开发】【1.5.100】诛仙装备开发 / 【前端】【1.5.100】诛仙装备开发
2个文件已修改
21个文件已添加
992 ■■■■■ 已修改文件
System/JadeDynastyKnapSack.meta 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/EquipTip.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI/Common/SortTable.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/JadeDynastyKnapSack.meta
New file
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a3c2973f5500e1c46ab255e7d5247562
folderAsset: yes
timeCreated: 1547867772
licenseType: Pro
DefaultImporter:
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs
New file
@@ -0,0 +1,76 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using EnhancedUI.EnhancedScroller;
using System.Collections.Generic;
namespace Snxxz.UI
{
    [XLua.Hotfix]
    public class JadeDynastyDecomposeLineBeh : ScrollerUI
    {
        [SerializeField] List<DecomposeItemBeh> itemBehs = new List<DecomposeItemBeh>();
        JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        public override void Refresh(CellView cell)
        {
            var decomposeGuids = decomposeModel.allGuids;
            int length = itemBehs.Count;
            for(int i = 0; i < length; i++)
            {
                var itemBeh = itemBehs[i];
                int index = cell.index*length + i;
                if(decomposeGuids != null
                    && index < decomposeGuids.Count)
                {
                    var guid = decomposeGuids[index];
                    var model = playerPack.GetItemModelByGUID(guid);
                    itemBeh.SetDisplay(model,decomposeModel.selectGuids);
                }
                else
                {
                    itemBeh.SetDisplay(null,null);
                }
            }
        }
        [Serializable]
        public class DecomposeItemBeh
        {
            [SerializeField] CommonItemBaisc itemBaisc;
            [SerializeField] GameObject selectObj;
            JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
            public void SetDisplay(ItemModel itemModel,List<string> selectGuids)
            {
                if (itemModel == null || selectGuids == null)
                {
                    itemBaisc.gameObject.SetActive(false);
                    selectObj.SetActive(false);
                }
                else
                {
                    itemBaisc.gameObject.SetActive(true);
                    selectObj.SetActive(selectGuids.Contains(itemModel.itemInfo.ItemGUID));
                    itemBaisc.Init(itemModel);
                    itemBaisc.cellBtn.RemoveAllListeners();
                    itemBaisc.cellBtn.AddListener(()=>
                    {
                        if(selectObj.activeInHierarchy)
                        {
                            this.decomposeModel.RemoveSelectModel(itemModel.itemInfo.ItemGUID);
                        }
                        else
                        {
                            this.decomposeModel.AddSelectModel(itemModel.itemInfo.ItemGUID);
                        }
                        selectObj.SetActive(!selectObj.activeInHierarchy);
                    });
                }
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6b9a652b72ad50041b82658a1246c004
timeCreated: 1548072997
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs
New file
@@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Snxxz.UI
{
    public class JadeDynastyDecomposeModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk
    {
        public int selectEquipLv { get; private set; }
        public bool isAutoDecompose { get; private set; }
        public string LocalSaveSelectEquipLv { get; private set;}
        public string LocalSaveAutoDecompose { get; private set;}
        public List<string> selectGuids { get; private set; }
        public List<string> allGuids { get; private set; }
        public event Action UpdateSelectItemEvent;
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        public override void Init()
        {
            selectGuids = new List<string>();
            allGuids = new List<string>();
        }
        public void OnBeforePlayerDataInitialize()
        {
        }
        public void OnAfterPlayerDataInitialize()
        {
            int playerId = (int)PlayerDatas.Instance.PlayerId;
            LocalSaveSelectEquipLv = StringUtility.Contact("JadeDynastyDecomposeSelectEquipLv",playerId);
            LocalSaveAutoDecompose = StringUtility.Contact("JadeDynastyAutoDecompose",playerId);
            GetSelectEquipLvByLocalSave();
            IsAutoDecomposeByLocalSave();
        }
        public void OnPlayerLoginOk()
        {
            UpdateDecomposeModels();
            UpdateSelectModels();
        }
        public override void UnInit()
        {
        }
        private int GetSelectEquipLvByLocalSave()
        {
            selectEquipLv = LocalSave.GetInt(LocalSaveSelectEquipLv);
            return selectEquipLv;
        }
        private bool IsAutoDecomposeByLocalSave()
        {
            isAutoDecompose = LocalSave.GetBool(LocalSaveAutoDecompose);
            return isAutoDecompose;
        }
        public void UpdateSelectEquipLv(int equipLv)
        {
            selectEquipLv = equipLv;
            UpdateSelectModels();
            LocalSave.SetInt(LocalSaveSelectEquipLv,equipLv);
        }
        public void UpdateIsAutoDecompose(bool isAuto)
        {
            isAutoDecompose = isAuto;
            LocalSave.SetBool(LocalSaveAutoDecompose,isAutoDecompose);
        }
        public void UpdateDecomposeModels()
        {
            allGuids.Clear();
            var singlePack = playerPack.GetSinglePackModel(PackType.rptJadeDynastyItem);
            if (singlePack == null) return;
            var itemDict = singlePack.GetPackModelIndexDict();
            foreach(var index in itemDict.Keys)
            {
                var model = itemDict[index];
                if(model.chinItemModel.EquipPlace > 0)
                {
                    allGuids.Add(model.itemInfo.ItemGUID);
                }
            }
        }
        public void UpdateSelectModels()
        {
            selectGuids.Clear();
            foreach(var guid in allGuids)
            {
                var model = playerPack.GetItemModelByGUID(guid);
                if(model != null)
                {
                    if (selectEquipLv != 0
                   && model.chinItemModel.LV <= selectEquipLv)
                    {
                        selectGuids.Add(model.itemInfo.ItemGUID);
                    }
                }
            }
            if(UpdateSelectItemEvent != null)
            {
                UpdateSelectItemEvent();
            }
        }
        public void AddSelectModel(string guid)
        {
            if (guid == null) return;
            if(!selectGuids.Contains(guid))
            {
                selectGuids.Add(guid);
                if(UpdateSelectItemEvent != null)
                {
                    UpdateSelectItemEvent();
                }
            }
        }
        public void RemoveSelectModel(string guid)
        {
            if (guid == null) return;
            if(selectGuids.Contains(guid))
            {
                selectGuids.Remove(guid);
                if (UpdateSelectItemEvent != null)
                {
                    UpdateSelectItemEvent();
                }
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d16f0dd3ef5fc9d48a0bbb2dae96ecf4
timeCreated: 1548069008
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs
New file
@@ -0,0 +1,115 @@
using System;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyDecomposeWin : Window
    {
        [SerializeField] ScrollerController decomposeCtrl;
        [SerializeField] SortTable sortTable;
        [SerializeField] Button closeBtn;
        [SerializeField] Button autoDecomposeBtn;
        [SerializeField] Button decomposeBtn;
        [SerializeField] Button selectBtn;
        [SerializeField] Image autoDecomposeImg;
        [SerializeField] Transform sortArrow;
        JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            closeBtn.AddListener(CloseClick);
            autoDecomposeBtn.AddListener(ClickAutoDecompose);
            decomposeBtn.AddListener(ClickDecompose);
            selectBtn.AddListener(ClickSelect);
        }
        protected override void OnPreOpen()
        {
            decomposeModel.UpdateSelectItemEvent += UpdateSelectItem;
            sortTable.onSortCloseEvent += CloseSortTable;
            sortTable.onSelectSortEvent += UpdateSelectEquipLv;
            sortTable.SetDefault();
            SetDisplay();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            decomposeModel.UpdateSelectItemEvent -= UpdateSelectItem;
            sortTable.onSortCloseEvent -= CloseSortTable;
            sortTable.onSelectSortEvent -= UpdateSelectEquipLv;
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void SetDisplay()
        {
            CreateItemLine();
            sortArrow.localRotation = Quaternion.Euler(0, 0, 180);
            sortTable.gameObject.SetActive(false);
            autoDecomposeImg.gameObject.SetActive(decomposeModel.isAutoDecompose);
        }
        private void CreateItemLine()
        {
            decomposeModel.UpdateDecomposeModels();
            decomposeModel.UpdateSelectModels();
            decomposeCtrl.Refresh();
            for(int i = 0; i < decomposeModel.allGuids.Count; i++)
            {
                decomposeCtrl.AddCell(ScrollerDataType.Header,i);
            }
            decomposeCtrl.Restart();
        }
        private void UpdateSelectEquipLv(SortType type, int lv)
        {
            if (type != SortType.EquipLv) return;
            decomposeModel.UpdateSelectEquipLv(lv);
        }
        private void UpdateSelectItem()
        {
            decomposeCtrl.m_Scorller.RefreshActiveCellViews();
        }
        private void CloseSortTable()
        {
            sortArrow.localRotation = Quaternion.Euler(0, 0, 180);
        }
        private void ClickSelect()
        {
            sortArrow.localRotation = Quaternion.Euler(0, 0, 0);
            if (!sortTable.gameObject.activeInHierarchy)
            {
                sortTable.gameObject.SetActive(true);
            }
        }
        private void ClickDecompose()
        {
        }
        private void ClickAutoDecompose()
        {
            autoDecomposeImg.gameObject.SetActive(!decomposeModel.isAutoDecompose);
            decomposeModel.UpdateIsAutoDecompose(!decomposeModel.isAutoDecompose);
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4058e063e60ae424592cd7af03ad4fc9
timeCreated: 1548064681
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs
New file
@@ -0,0 +1,81 @@
using System;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyEquipBeh : MonoBehaviour
    {
        [SerializeField] RoleEquipType equipType = RoleEquipType.retMax;
        [SerializeField] GameObject lockObj;
        [SerializeField] ItemCell itemCell;
        [SerializeField] Text lockText;
        [SerializeField] Text nameText;
        [SerializeField] Button equipBtn;
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        private void OnEnable()
        {
            playerPack.ItemCntAddAct += PutOnEquip;
            playerPack.ItemCntReduceAct += PutOffEquip;
            SetDisplay();
        }
        private void OnDisable()
        {
            playerPack.ItemCntAddAct -= PutOnEquip;
            playerPack.ItemCntReduceAct -= PutOffEquip;
        }
        public void SetDisplay()
        {
            bool islock = false;
            int towerLayer = 1;
            lockObj.SetActive(islock);
            lockText.gameObject.SetActive(islock);
            nameText.text = string.Empty;
            nameText.gameObject.SetActive(false);
            equipBtn.RemoveAllListeners();
            itemCell.cellBtn.RemoveAllListeners();
            if(islock)
            {
                itemCell.gameObject.SetActive(false);
                lockText.text = StringUtility.Contact("诛仙塔/n",towerLayer,"层解锁");
            }
            else
            {
                ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptJadeDynastyEquip,(int)equipType);
                itemCell.gameObject.SetActive(itemModel != null);
                if(itemModel != null)
                {
                    itemCell.Init(itemModel);
                    itemCell.cellBtn.AddListener(() => { ClickItemCell(itemModel); });
                }
            }
        }
        private void PutOffEquip(PackType type, int index, int id)
        {
            if (type != PackType.rptJadeDynastyEquip || index != (int)equipType) return;
            SetDisplay();
        }
        private void PutOnEquip(PackType type, int index, int id)
        {
            if (type != PackType.rptJadeDynastyEquip || index != (int)equipType) return;
            SetDisplay();
        }
        private void ClickItemCell(ItemModel item)
        {
            if (item == null) return;
            tipsModel.SetItemTipsModel(item.packType,item.itemInfo.ItemGUID);
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 932f7caddd34f5848a1b609234d55caa
timeCreated: 1548035370
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
New file
@@ -0,0 +1,97 @@
using System;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyEquipWin : Window
    {
        [SerializeField] Button decomposeBtn;
        [Header("诛仙装备位")]
        [SerializeField] Button stoneAttrBtn;
        [SerializeField] Button suitAttrBtn;
        [Header("诛仙背包")]
        [SerializeField] ScrollerController itemCtrl;
        [SerializeField] int initCount = 100;
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            decomposeBtn.AddListener(ClickDecompose);
            stoneAttrBtn.AddListener(ClickStoneAttr);
            suitAttrBtn.AddListener(ClickSuitAttr);
        }
        protected override void OnPreOpen()
        {
            playerPack.RefreshItemCountAct += UpdateJadeDynastyItem;
            SetDisplay();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            playerPack.RefreshItemCountAct -= UpdateJadeDynastyItem;
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void SetDisplay()
        {
            CreateItemLine();
        }
        private void CreateItemLine()
        {
            itemCtrl.Refresh();
            int line = initCount / 5;
            for(int i = 0; i < line; i++)
            {
                itemCtrl.AddCell(ScrollerDataType.Header,i);
            }
            itemCtrl.Restart();
        }
        private void UpdateJadeDynastyItem(PackType type, int index, int id)
        {
            if (type != PackType.rptJadeDynastyItem) return;
            UpdateItemLine();
        }
        private void UpdateItemLine()
        {
            itemCtrl.m_Scorller.RefreshActiveCellViews();
        }
        private void ClickSuitAttr()
        {
            WindowCenter.Instance.Open<JadeDynastySuitAttrWin>();
        }
        private void ClickStoneAttr()
        {
        }
        private void ClickDecompose()
        {
            WindowCenter.Instance.Open<JadeDynastyDecomposeWin>();
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: aece173e3072f4a45ac2c3d45709d527
timeCreated: 1547867941
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs
New file
@@ -0,0 +1,39 @@
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyItemBeh : MonoBehaviour
    {
        [SerializeField] ItemCell itemCell;
        [SerializeField] Button lockBtn;
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        public void SetDisplay(int index)
        {
            var singlePack = playerPack.GetSinglePackModel(PackType.rptJadeDynastyItem);
            if (singlePack == null) return;
            var itemModel = playerPack.GetItemModelByIndex(PackType.rptJadeDynastyItem, index);
            itemCell.gameObject.SetActive(itemModel != null);
            if(itemModel != null)
            {
                lockBtn.gameObject.SetActive(false);
                itemCell.Init(itemModel,true);
                itemCell.cellBtn.RemoveAllListeners();
                itemCell.cellBtn.AddListener(()=>
                {
                    tipsModel.SetItemTipsModel(itemModel.packType,itemModel.itemInfo.ItemGUID);
                });
            }
            else
            {
                bool isLock = index > (singlePack.openGridCount - 1);
                lockBtn.gameObject.SetActive(isLock);
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e6b6e570c6125ef46842e12a39509708
timeCreated: 1548038720
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs
New file
@@ -0,0 +1,25 @@
using UnityEngine;
using UnityEngine.UI;
using EnhancedUI.EnhancedScroller;
using System.Collections.Generic;
namespace Snxxz.UI
{
    public class JadeDynastyItemLineBeh : ScrollerUI
    {
        [SerializeField] List<JadeDynastyItemBeh> itemBehs = new List<JadeDynastyItemBeh>();
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        public override void Refresh(CellView cell)
        {
            int length = itemBehs.Count;
            for(int i = 0; i < length; i++)
            {
                int index = cell.index * length + i;
                var itemBeh = itemBehs[i];
                itemBeh.SetDisplay(index);
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 90b8c7969d616ae458ab3efef2d4880d
timeCreated: 1548038657
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs
New file
@@ -0,0 +1,84 @@
using System;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastyKnapSackWin : Window
    {
        [SerializeField] FunctionButton funcEquip;
        [SerializeField] FunctionButtonGroup funcGroup;
        [SerializeField] Button closeBtn;
        [SerializeField] Button leftBtn;
        [SerializeField] Button rightBtn;
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            closeBtn.AddListener(CloseClick);
            leftBtn.AddListener(ClickLeft);
            rightBtn.AddListener(ClickRight);
            funcEquip.AddListener(ClickFuncEquip);
        }
        protected override void OnPreOpen()
        {
        }
        protected override void OnActived()
        {
            base.OnActived();
            funcGroup.TriggerByOrder(functionOrder);
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void ClickRight()
        {
            funcGroup.TriggerNext();
        }
        private void ClickLeft()
        {
            funcGroup.TriggerLast();
        }
        private void ClickFuncEquip()
        {
            CloseSubWindows();
            if (windowState == WindowState.Opened)
            {
                WindowCenter.Instance.OpenWithoutAnimation<JadeDynastyKnapSackWin>();
            }
            else
            {
                WindowCenter.Instance.Open<JadeDynastyKnapSackWin>();
            }
            functionOrder = funcEquip.order;
        }
        private void CloseSubWindows()
        {
            var children = WindowConfig.Get().FindChildWindows(this.GetType().Name);
            foreach (var window in children)
            {
                WindowCenter.Instance.Close(window);
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5336f00e3c02082409234c4d9281b34a
timeCreated: 1547867941
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs
New file
@@ -0,0 +1,108 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using TableConfig;
namespace Snxxz.UI
{
    public class JadeDynastySuitAttrBeh : MonoBehaviour
    {
        [SerializeField] Text titleText;
        [SerializeField] List<SuitAttr> suitAttrs = new List<SuitAttr>();
        [SerializeField] GameObject noneActive;
        public void SetDisplay(int suitLv,bool isNext = false)
        {
            bool isShowNoneActive = false;
            if (!isNext)
            {
                bool isActive = true;
                isShowNoneActive = !isActive;
                titleText.text = StringUtility.Contact("套装总属性");
            }
            else
            {
                bool isMaxSuitLv = false;
                isShowNoneActive = isMaxSuitLv;
                titleText.text = StringUtility.Contact("进阶属性");
            }
            if(noneActive != null)
            {
                noneActive.SetActive(isShowNoneActive);
            }
            for(int i = 0; i < suitAttrs.Count; i++)
            {
                var suitAttr = suitAttrs[i];
                suitAttr.SetDisplay(i,1,null,null);
            }
        }
        [Serializable]
        public class SuitAttr
        {
            [SerializeField] Text suitTypeText;
            [SerializeField] List<GameObject> attrObjlist = new List<GameObject>();
            [SerializeField] List<Text> attrTextlist = new List<Text>();
            [SerializeField] Text activeText;
            [SerializeField] GameObject activeObj;
            ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
            public void SetDisplay(int suitType,int suitLv,List<int> ids,List<int> values)
            {
                if (ids == null || values == null) return;
                bool isActive = true;
                switch(suitType)
                {
                    case 0:
                        suitTypeText.text = StringUtility.Contact("诛仙守护LV." + suitLv);
                        break;
                    case 1:
                        suitTypeText.text = StringUtility.Contact("诛仙之力LV." + suitLv);
                        break;
                    case 2:
                        suitTypeText.text = StringUtility.Contact("诛仙剑阵LV." + suitLv);
                        break;
                }
                activeObj.SetActive(!isActive);
                if(!isActive)
                {
                    string conditionSB = StringUtility.Contact("达到8阶激活");
                }
                for (int i = 0; i < attrObjlist.Count; i++)
                {
                    var attrObj = attrObjlist[i];
                    attrObj.SetActive(i < ids.Count);
                    if(i < ids.Count)
                    {
                        var attrId = ids[i];
                        var attrValue = values[i];
                        var attrText = attrTextlist[i];
                        var attrConfig = Config.Instance.Get<PlayerPropertyConfig>(attrId);
                        string attrSB = string.Empty;
                        string attrValueSB = string.Empty;
                        if (isActive)
                        {
                          attrValueSB = UIHelper.AppendStringColor(TextColType.Green, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
                        }
                        else
                        {
                            attrValueSB = UIHelper.AppendStringColor(TextColType.Gray, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
                        }
                        if (attrConfig.Name.Contains("%s"))
                        {
                            attrSB = attrConfig.Name.Replace("%s", attrValueSB);
                        }
                        else
                        {
                            attrSB = StringUtility.Contact(attrConfig.Name, "+", attrValueSB);
                        }
                        attrText.text = attrSB;
                    }
                }
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fd03e25d39702af45834d010b9ce3c1f
timeCreated: 1548051833
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs
New file
@@ -0,0 +1,58 @@
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class JadeDynastySuitAttrWin : Window
    {
        [SerializeField] JadeDynastySuitAttrBeh curSuitAttrBeh;
        [SerializeField] JadeDynastySuitAttrBeh nextSuitAttrBeh;
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
        }
        protected override void OnPreOpen()
        {
            SetDisplay();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        private void SetDisplay()
        {
            int curSuitLv = 0;
            int nextSuitLv = 1;
            bool isMaxSuitLv = false;
            nextSuitAttrBeh.gameObject.SetActive(!isMaxSuitLv);
            if(isMaxSuitLv)
            {
                curSuitAttrBeh.SetDisplay(curSuitLv);
            }
            else
            {
                curSuitAttrBeh.SetDisplay(curSuitLv);
                nextSuitAttrBeh.SetDisplay(nextSuitLv,true);
            }
        }
    }
}
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 57eff5f7971a1f74da451b3bde6e9606
timeCreated: 1548051551
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/KnapSack/Logic/EquipTip.cs
@@ -94,6 +94,11 @@
        [SerializeField]
        ScrollerController suirAttrCtrl;
        [Header("诛仙套装")]
        [SerializeField] GameObject jadeDynastySuitObj;
        [SerializeField] JadeDynastySuitAttrBeh curJadeDynastySuitAttr;
        [SerializeField] JadeDynastySuitAttrBeh nextJadeDynastySuitAttr;
        [SerializeField] List<GameObject> attrCutLinelist = new List<GameObject>();
        #endregion
@@ -235,6 +240,7 @@
            SetWashAttrUI();
            SetGemAttrUI();
            SetSuitAttrUI();
            SetJadeDynastySuitAttr();
            for (int i = 0; i < attrCutLinelist.Count; i++)
            {
                if (i == curAttrTypeNum - 1)
@@ -843,6 +849,37 @@
            }
        }
        private void SetJadeDynastySuitAttr()
        {
            if (jadeDynastySuitObj == null) return;
            if(itemAttrData.itemConfig.EquipPlace >= (int)RoleEquipType.JadeDynasty_Cloak
                && itemAttrData.itemConfig.EquipPlace <= (int)RoleEquipType.JadeDynasty_Sword4)
            {
                jadeDynastySuitObj.SetActive(true);
            }
            else
            {
                jadeDynastySuitObj.SetActive(false);
                return;
            }
            bool isMaxSuitLv = false;
            int maxSuitLv = 1;
            int curSuitLv = itemAttrData.packType == PackType.rptJadeDynastyItem ? maxSuitLv : 0;
            bool isShowNext = !isMaxSuitLv && itemAttrData.packType == PackType.rptJadeDynastyItem;
            nextJadeDynastySuitAttr.gameObject.SetActive(isShowNext);
            if(isShowNext)
            {
                curJadeDynastySuitAttr.SetDisplay(curSuitLv);
                nextJadeDynastySuitAttr.SetDisplay(curSuitLv + 1);
            }
            else
            {
                curJadeDynastySuitAttr.SetDisplay(curSuitLv);
            }
        }
        private void SetMidUIHeight(float midHeight)
        {
            scrollRect.enabled = false;
UI/Common/SortTable.cs
@@ -93,6 +93,7 @@
    {
        EquipQuality,
        EquipStar,
        EquipLv,
    }
    [Serializable]
    public struct SortElement