少年修仙传客户端代码仓库
Client_PangDeRong
2018-11-08 43971a2a2b8378f99bbf1bcfda947169d948f136
4617 【前端】【1.2.0】门票合成支持单材料显示
1个文件已修改
61 ■■■■■ 已修改文件
System/Compose/New/ComposeTicketWin.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeTicketWin.cs
@@ -20,35 +20,22 @@
        [SerializeField] GameObject costMoneyObj;
        [SerializeField] Button composeBtn;
        [SerializeField] Button allComposeBtn;
        [SerializeField] UIEffect composeEffect;
        [SerializeField] UIEffect twoMatComposeEffect;
        [SerializeField] UIEffect oneMatComposeEffect;
        [Header("一个固定物品和非固定物品")]
        [SerializeField] List<ComposeMatCell> oneMatFixedAndUnfixeds = new List<ComposeMatCell>();
        [Header("非一个固定物品和非固定物品")]
        [SerializeField] List<ComposeMatCell> twoMatFixedAndUnfixeds = new List<ComposeMatCell>();
        [Header("合成物品")]
        [SerializeField] List<ComposeMatCell> makeItems = new List<ComposeMatCell>();
        [SerializeField]
        List<GameObject> sourceItemlist = new List<GameObject>();
        [SerializeField]
        List<GameObject> previewItemlist = new List<GameObject>();
        ComposeWinModel _composeWinModel;
        ComposeWinModel composeWinModel
        {
            get { return _composeWinModel ?? (_composeWinModel = ModelCenter.Instance.GetModel<ComposeWinModel>()); }
        }
        ItemTipsModel _itemTipsModel;
        ItemTipsModel itemTipsModel
        {
            get
            {
                return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
            }
        }
        PlayerPackModel _playerPack;
        PlayerPackModel playerPack
        {
@@ -62,14 +49,6 @@
            get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
        }
        GetItemPathModel ItemPathModel
        {
            get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); }
        }
        private Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> firstTypeDict = null;
        private Dictionary<int, List<ItemCompoundConfig>> secondTypeDict = null;
        private List<ItemCompoundConfig> thirdTypelist = null;
        ComposeWinModel.ComposeFirstTypeData firstTypeData;
        ComposeWinModel.ComposeSecondTypeData secondTypeData;
        ComposeWinModel.ComposeThirdTypeData thirdTypeData;
@@ -79,15 +58,7 @@
        private int preSecondType = 0;
        [SerializeField] int initSuccessRate = 10000;
        ItemCompoundConfig compoundModel = null;
        SelectEquipModel _selectModel;
        private Dictionary<int,List<int>> fixedItemIndexDict = new Dictionary<int, List<int>>();
        SelectEquipModel selectModel
        {
            get { return _selectModel ?? (_selectModel = ModelCenter.Instance.GetModel<SelectEquipModel>()); }
        }
        AchievementGuideEffect guidEffect = null;
        protected override void BindController()
@@ -541,6 +512,25 @@
           
            _moneyCountText.text = modelInterface.OnChangeCoinsUnit((ulong)compoundModel.money);
        }
        private UIEffect GetPlayMatEffect()
        {
            if (compoundModel == null) return null;
            int[] fixedIds = compoundModel.itemID;
            if(fixedIds != null)
            {
                if(fixedIds.Length < 2)
                {
                    return oneMatComposeEffect;
                }
                else
                {
                    return twoMatComposeEffect;
                }
            }
            return null;
        }
        #endregion
        private void ResetModel()
        {
@@ -593,7 +583,7 @@
                    break;
                }
            }
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCnt);
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,GetPlayMatEffect(), composeCnt);
        }
        private void OnClickComposeBtn()
@@ -601,7 +591,7 @@
            if (compoundModel == null) return;
            SetFixedItemIndexDic();
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,GetPlayMatEffect(),1);
        }
        private void SetFixedItemIndexDic()
@@ -656,7 +646,6 @@
            }
            RefreshUI(compoundModel);
            selectModel.ClearSelectModel();
        }
    }
}