少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-26 82931aabaaa3e479bc04e11630a77cd9c9dd5fe3
System/KnapSack/New/RoleEquipWin.cs
@@ -17,30 +17,8 @@
    public class RoleEquipWin : Window
    {
        #region 成员变量
        [SerializeField]
        private GameObject _beastArea; //灵守
        [SerializeField]
        private GameObject _helmetArea; //头盔
        [SerializeField]
        private GameObject _clothArea; //胸甲
        [SerializeField]
        private GameObject _pantsArea; //护腿
        [SerializeField]
        private GameObject _shoesArea;  //鞋子
        [SerializeField]
        private GameObject _weaponArea; //武器
        [SerializeField]
        private GameObject _retWeapon2;  //副手
        [SerializeField]
        private GameObject _fairy01Area; //圣器1
        [SerializeField]
        private GameObject _fairy02Area; //圣器2`
        [SerializeField]
        private GameObject _necklaceArea; //项链
        [SerializeField]
        private GameObject _beltArea; //腰带
        [SerializeField]
        private GameObject _wingsArea;  //翅膀
        [SerializeField] List<EquipPlaceCell> equipPlaces = new List<EquipPlaceCell>();
        [SerializeField] RawImage RoleShowBG;
        [SerializeField]
        private Button _starCountBtn;
@@ -70,13 +48,6 @@
            get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
        }
        private FuncConfigConfig _equipPlaceModel;
        private List<string> _equipCodelist;
        private List<string> _equipNamelist;
        private RoleEquipType _equipType;
        private BagWin bagWin;
        private Dictionary<int,ItemModel> _roleEquipDict = new Dictionary<int,ItemModel>();
        private Dictionary<RoleEquipType ,GameObject> equipArealist = new Dictionary<RoleEquipType, GameObject>();
        ItemTipsModel _itemTipsModel;
        ItemTipsModel itemTipsModel
@@ -96,19 +67,6 @@
        protected override void BindController()
        {
            equipArealist.Add(RoleEquipType.retWeapon, _weaponArea);
            equipArealist.Add(RoleEquipType.retClothes, _clothArea);
            equipArealist.Add(RoleEquipType.retHat, _helmetArea);
            equipArealist.Add(RoleEquipType.retTrousers, _pantsArea);
            equipArealist.Add(RoleEquipType.retShoes, _shoesArea);
            equipArealist.Add(RoleEquipType.retNeck, _necklaceArea);
            equipArealist.Add(RoleEquipType.retWeapon2, _retWeapon2);
            equipArealist.Add(RoleEquipType.retFairyCan, _fairy01Area);
            equipArealist.Add(RoleEquipType.retFairyCan2, _fairy02Area);
            equipArealist.Add(RoleEquipType.retBelt, _beltArea);
            equipArealist.Add(RoleEquipType.retWing, _wingsArea);
            equipArealist.Add(RoleEquipType.retSpiritAnimal, _beastArea);
            _oneKeySellBtn.onClick.AddListener(OnClickOneKeySell);
            _sortBtn.onClick.AddListener(() => { OnClickSortBtn(); });
        }
@@ -144,12 +102,6 @@
            UIEventTrigger.Get(_starCountBtn.gameObject).OnDown = OnClickStarBtn;
            UIEventTrigger.Get(_equipIntensifyBtn.gameObject).OnDown = OnClickEquipIntensify;
            foreach (var go in equipArealist.Values)
            {
                GameObject itemCell = go.transform.Find("ItemCell").gameObject;
                itemCell.gameObject.SetActive(false);
            }
            OnFrenshBagInfo();
        }
@@ -162,26 +114,12 @@
        protected override void OnAfterOpen()
        {
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptEquip);
            if(singlePack != null)
            {
                Dictionary<int,ItemModel> itemPlaceDict = singlePack.GetPackModelIndexDict();
                foreach (var model in itemPlaceDict.Values)
                {
                    PutOnEquip(model.packType,model.itemInfo.ItemPlace,model.itemInfo.ItemID);
                }
            }
            SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
            if(successConfig != null && successConfig.Type == 95)
            {
                playerPack.SetJumpToOneKeySell(_oneKeySellBtn.transform);
            }
            //if(playerPack.IsActiveSTRAttr())
            //{
            //    ControlEffect(0,true);
            //}
            if(playerPack.IsActiveStarAttr())
            {
@@ -231,42 +169,28 @@
            }
        }
        public void UpdateRoleEquip(int equipPlace)
        {
            for (int i = 0; i < equipPlaces.Count; i++)
            {
                equipPlaces[i].Display(equipPlace);
            }
            UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
        }
        public void PutOnEquip(PackType type,int index, int Id)
        {
            //临时条件判断
            if (type != PackType.rptEquip || !equipArealist.ContainsKey((RoleEquipType)index)) return;
            if (type != PackType.rptEquip) return;
            ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip,index);
            ItemCell itemCell = equipArealist[(RoleEquipType)index].transform.Find("ItemCell").GetComponent<ItemCell>();
            itemCell.gameObject.SetActive(true);
            itemCell.Init(itemModel);
            itemCell.cellBtn.onClick.RemoveAllListeners();
            itemCell.cellBtn.onClick.AddListener(()=> {
                itemTipsModel.SetItemTipsModel(PackType.rptEquip, itemModel.itemInfo.ItemGUID,false);
                itemTipsModel.SetPutOnTipsBtn(itemTipsModel.curAttrData);
                itemTipsModel.ShowUICtrl();
            });
            if (_roleEquipDict.ContainsKey(itemModel.itemInfo.ItemPlace))
            {
                _roleEquipDict[itemModel.itemInfo.ItemPlace] = itemModel;
            }
            else
            {
                _roleEquipDict.Add(itemModel.itemInfo.ItemPlace,itemModel);
            }
            UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
            UpdateRoleEquip(index);
        }
        public void PutOffEquip(PackType type, int place,int id)
        {
            if (type != PackType.rptEquip) return;
            ClearEquipInfo(place);
            equipArealist[(RoleEquipType)place].transform.Find("ItemCell").gameObject.SetActive(false);
            UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
            UpdateRoleEquip(place);
        }
        private void OnClickEquipIntensify(GameObject go)
@@ -278,35 +202,7 @@
        {
            WindowCenter.Instance.Open<PlayerStarNumWin>();
        }
        public void ClearEquipInfo(int place)
        {
            if (_roleEquipDict.ContainsKey(place))
            {
                _roleEquipDict.Remove(place);
            }
        }
        public bool CheckEquipIfPutOn(int equipPlace)
        {
            if (_roleEquipDict.ContainsKey(equipPlace))
                return true;
            return false;
        }
 
        private List<string> GetToolsList(string tools, List<string> toolslist)
        {
            toolslist = new List<string>();
            string[] toolsArray = tools.Split('|');
            for (int i = 0; i < toolsArray.Length; i++)
            {
                toolslist.Add(toolsArray[i]);
            }
            return toolslist;
        }
        public void OnClickSortBtn()
        {
            modelInterface.SendPackResetQuest(PackType.rptItem);
@@ -316,7 +212,6 @@
            _sortBtn.enabled = false;
          
        }
        private void RefreshTime(float time)
        {