少年修仙传客户端代码仓库
client_Wu Xijin
2019-04-13 43828dce1bfb99809bc46d206fe7aadf79319efa
3335 整理代码
3个文件已修改
103 ■■■■■ 已修改文件
System/KnapSack/Logic/GuardTip.cs 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/GuardianWin.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/Logic/BuyGuardTip.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/GuardTip.cs
@@ -70,14 +70,8 @@
        Dictionary<PropertyType, int> needPointDict = new Dictionary<PropertyType, int>();
        ItemTipsModel _itemTipsModel;
        ItemTipsModel itemTipsModel
        {
            get
            {
                return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
            }
        }
        ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        ItemAttrData itemAttrData;
        Color32 conditionColor = new Color32(255, 244, 205, 255);
@@ -116,7 +110,7 @@
        IEnumerator SetPanelScale()
        {
            yield return null;
            if(itemAttrData.isCompare)
            if (itemAttrData.isCompare)
            {
                if (itemAttrData.packType != PackType.Equip)
                {
@@ -140,8 +134,8 @@
            #region 设置TopUI
            titleText.text = itemTipsModel.GetItemTipsTitle(itemAttrData);
            titleText.color = UIHelper.GetUIColor(itemAttrData.itemConfig.ItemColor);
            ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId,itemAttrData.isPreview, (ulong)itemAttrData.count,
                itemAttrData.guid,itemAttrData.packType,itemAttrData.isCompare, itemAttrData.useDataDict);
            ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId, itemAttrData.isPreview, (ulong)itemAttrData.count,
                itemAttrData.guid, itemAttrData.packType, itemAttrData.isCompare, itemAttrData.useDataDict);
            itemCell.Init(cellModel);
            if (itemAttrData.packType == PackType.Equip)
            {
@@ -156,7 +150,7 @@
            equipScoreValue.text = itemAttrData.score.ToString();
            RefreshNeedPointUI();
            needLvDes.text = Language.Get("KnapS110");
            if (itemAttrData.itemConfig.UseLV > 1)
            {
                needLvDes.gameObject.SetActive(true);
@@ -168,7 +162,7 @@
                needLvValue.gameObject.SetActive(false);
            }
            if(itemAttrData.isHavePutLimit)
            if (itemAttrData.isHavePutLimit)
            {
                needLvValue.text = itemAttrData.itemConfig.UseLV.ToString();
                if (PlayerDatas.Instance.baseData.LV >= itemAttrData.itemConfig.UseLV)
@@ -198,9 +192,9 @@
            #region 设置功能按钮
            operateBtn.SetActive(false);
            if(itemAttrData.isCompare)
            if (itemAttrData.isCompare)
            {
                if(itemAttrData.packType != PackType.Equip)
                if (itemAttrData.packType != PackType.Equip)
                {
                    CreateFuncBtn();
                }
@@ -214,7 +208,7 @@
        private void OnDisable()
        {
           KnapsackTimeCDMgr.Instance.RefreshItemOverdueTimeAct -= RefreshRemainTime;
            KnapsackTimeCDMgr.Instance.RefreshItemOverdueTimeAct -= RefreshRemainTime;
        }
        private void RefreshRemainTime(string guid)
@@ -223,12 +217,13 @@
            {
                return;
            }
            double remainTime = 0;
            bool isRemain = itemAttrData.TryGetItemRemainTime(out remainTime);
            dateText.gameObject.SetActive(isRemain);
            if (isRemain)
            var isOverdue = ItemLogicUtility.Instance.IsOverdue(guid);
            dateText.gameObject.SetActive(!isOverdue);
            if (!isOverdue)
            {
                SetDateLimitUI(remainTime);
                var item = packModel.GetItemByGuid(guid);
                SetDateLimitUI(item != null ? item.overdueSurplusTime : 0);
            }
        }
@@ -400,10 +395,11 @@
                {
                    Button btn = OnGUIButton(btnGroup.gameObject, operateBtn, key.ToString(), Language.Get(StringUtility.Contact("ItemHandle_", key.ToString())));
                    btn.RemoveAllListeners();
                    btn.onClick.AddListener(() => {
                    btn.onClick.AddListener(() =>
                    {
                        OnClickCloseBtn();
                        itemAttrData.tipsFuncBtnDic[key](key,"");
                        itemAttrData.tipsFuncBtnDic[key](key, "");
                    });
                }
            }
System/KnapSack/New/GuardianWin.cs
@@ -9,11 +9,11 @@
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI {
namespace Snxxz.UI
{
    public class GuardianWin : Window
    {
        #region 成员变量
        [SerializeField]
        GuardTip guardTip;
@@ -27,14 +27,7 @@
        private List<GameObject> TempCreatelist = new List<GameObject>();
        ItemTipsModel _itemTipsModel;
        ItemTipsModel itemTipsModel
        {
            get
            {
                return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
            }
        }
        ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        #region Built-in
        protected override void BindController()
@@ -101,7 +94,7 @@
                {
                    switch (itemTipsModel.curAttrData.ChildType)
                    {
                        case ItemTipChildType.Normal:
                        case ItemTipChildType.Normal:
                            GuardTip compareTip = CloneEquipUI(this.transform, guardTip.gameObject).GetComponent<GuardTip>();
                            compareTip.InitModel(itemTipsModel.compareAttrData);
                            TempCreatelist.Add(compareTip.gameObject);
@@ -131,7 +124,7 @@
        public void OnHidePanel()
        {
            CloseImmediately();
        }
System/Store/Logic/BuyGuardTip.cs
@@ -101,20 +101,8 @@
        Dictionary<PropertyType, int> needPointDict = new Dictionary<PropertyType, int>();
        ItemTipsModel _itemTipsModel;
        ItemTipsModel itemTipsModel
        {
            get
            {
                return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
            }
        }
        StoreModel _storeModel;
        StoreModel m_storeModel
        {
            get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
        }
        ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        StoreModel m_storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
        ItemAttrData itemAttrData;
        BuyItemPopModel buyItem;
@@ -176,8 +164,8 @@
            #region 设置TopUI
            titleText.text = itemTipsModel.GetItemTipsTitle(itemAttrData);
            titleText.color = UIHelper.GetUIColor(itemAttrData.itemConfig.ItemColor);
            ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId,itemAttrData.isPreview, (ulong)itemAttrData.count,
                itemAttrData.guid,itemAttrData.packType,itemAttrData.isCompare, itemAttrData.useDataDict);
            ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId, itemAttrData.isPreview, (ulong)itemAttrData.count,
                itemAttrData.guid, itemAttrData.packType, itemAttrData.isCompare, itemAttrData.useDataDict);
            itemCell.Init(cellModel);
            equipScoreDes.text = Language.Get("EquipWin_EquipPointText_1");
            equipScoreValue.text = itemAttrData.score.ToString();
@@ -228,7 +216,7 @@
            #region 设置MidUI
            SetBasicAttrUI();
            #endregion
        }
        private void OnDisable()
@@ -301,7 +289,7 @@
                    switch (needlist[i])
                    {
                        case PropertyType.POWER:
                            if(itemAttrData.isHavePutLimit)
                            if (itemAttrData.isHavePutLimit)
                            {
                                SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS113"));
                            }
@@ -309,9 +297,9 @@
                            {
                                SetNeedPointUI(1, 0, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS113"));
                            }
                           break;
                            break;
                        case PropertyType.AGILITY:
                            if(itemAttrData.isHavePutLimit)
                            if (itemAttrData.isHavePutLimit)
                            {
                                SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS112"));
                            }
@@ -319,10 +307,10 @@
                            {
                                SetNeedPointUI(1, 0, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS112"));
                            }
                            break;
                        case PropertyType.MENTALITY:
                            if(itemAttrData.isHavePutLimit)
                            if (itemAttrData.isHavePutLimit)
                            {
                                SetNeedPointUI(needPointDict[needlist[i]], offset, needPointTextlist[i], needPointNumlist[i], Language.Get("KnapS111"));
                            }
@@ -398,7 +386,7 @@
            int addBuyCnt = 0;
            bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
            bool isReachUpper = false;
            buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit,isVipBuy), out isReachUpper);
            buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
            if (isVipBuy)
            {
                if (nextVipIndex != -1)
@@ -430,7 +418,7 @@
            buyCountText.text = buyCnt.ToString();
            RefreshBuyPrice(buyCnt);
            moneyIcon.SetIconWithMoneyType(buyItem.storeConfig.MoneyType);
         }
        }
        private void SetBottomText(EquipSource source)
        {
@@ -477,12 +465,12 @@
            if (_price <= 0 || itemAttrData.itemConfig.PackCount < 2)
            {
                _numberGo.gameObject.SetActive(false);
            }
            else
            {
                _numberGo.gameObject.SetActive(true);
            }
        }
        #region 点击事件
@@ -565,7 +553,7 @@
        {
            KnapSackEventMgr.Instance.HideItemPopWin();
        }
       #endregion
        #endregion
    }
}