少年修仙传客户端代码仓库
client_Wu Xijin
2018-11-08 ddaa4e2f9ba1c56485e305c335408e072cafc53c
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已添加
4个文件已修改
1059 ■■■■■ 已修改文件
System/Compose/New/ComposeMatCell.cs 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeMatCell.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeTicketWin.cs 780 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeWinModel.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/SelectEquipModel.cs 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/SelectItemWin.cs 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeMatCell.cs
New file
@@ -0,0 +1,164 @@
using UnityEngine;
using UnityEngine.UI;
using TableConfig;
using System;
namespace Snxxz.UI
{
    public class ComposeMatCell : MonoBehaviour
    {
        [SerializeField] Button selectBtn;
        [SerializeField] ItemCell itemCell;
        [SerializeField] GameObject lockObj;
        [SerializeField] Text desText;
        NeedMatType matType = NeedMatType.Nothing;
        int itemId = 0;
        ItemModel itemModel;
        ItemCompoundConfig itemCompound;
        PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
        GetItemPathModel pathModel { get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); } }
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        SelectEquipModel selectModel {get { return ModelCenter.Instance.GetModel<SelectEquipModel>(); }}
        public void SetDisplay(ItemCompoundConfig _itemCompound,NeedMatType _matType,bool isLock,string des = "", int _itemId = 0,int _itemIndex = -1)
        {
            this.itemCompound = _itemCompound;
            this.matType = _matType;
            this.itemId = _itemId;
            desText.gameObject.SetActive(des != "" && !string.IsNullOrEmpty(des));
            desText.text = des;
            this.itemModel = playerPack.GetItemModelByIndex(PackType.rptItem,_itemIndex);
            lockObj.SetActive(isLock);
            bool isShowMat = _itemId != 0 || itemModel != null ? true : false;
            itemCell.gameObject.SetActive(isShowMat);
            itemCell.cellBtn.RemoveAllListeners();
            if(isShowMat)
            {
                if(itemModel != null)
                {
                    itemCell.Init(itemModel);
                    itemCell.cellBtn.AddListener(ClickItemCell);
                }
                else
                {
                    ItemCellModel cellModel = new ItemCellModel(itemId);
                    itemCell.Init(cellModel);
                    itemCell.cellBtn.AddListener(ClickItemCell);
                }
            }
            UpdateMatCount();
            selectBtn.RemoveAllListeners();
            selectBtn.AddListener(ClickSelect);
        }
        private void UpdateMatCount()
        {
            switch (matType)
            {
                case NeedMatType.IncreaseItem:
                case NeedMatType.fixedItem:
                    int needCount = 0;
                    TryGetCountById(out needCount);
                    int haveCount = playerPack.GetItemCountByID(PackType.rptItem, itemId);
                    itemCell.countText.gameObject.SetActive(true);
                    if (haveCount >= needCount)
                    {
                        itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green, haveCount.ToString()),
                            "/", needCount);
                    }
                    else
                    {
                        itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
                            "/", needCount);
                    }
                    break;
                case NeedMatType.unfixedItem:
                case NeedMatType.Nothing:
                case NeedMatType.MakeItem:
                case NeedMatType.addItem:
                    itemCell.countText.gameObject.SetActive(false);
                    break;
            }
        }
        private bool TryGetCountById(out int itemCount)
        {
            itemCount = 0;
            if (itemCompound == null) return false;
            switch (matType)
            {
                case NeedMatType.IncreaseItem:
                    int[] increases = itemCompound.successRateIncrease;
                    if(increases != null && increases.Length >= 3)
                    {
                        itemCount = increases[1];
                        return true;
                    }
                    break;
                case NeedMatType.fixedItem:
                    int[] fixedIds = itemCompound.itemID;
                    int[] fixedCounts = itemCompound.itemCount;
                    if (fixedIds != null)
                    {
                        for(int i = 0; i < fixedIds.Length; i++)
                        {
                            if(fixedIds[i] == itemId)
                            {
                                itemCount = fixedCounts[i];
                                return true;
                            }
                        }
                    }
                    break;
            }
            return false;
        }
        private void ClickItemCell()
        {
            ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
            ItemAttrData attrData = null;
            switch (matType)
            {
                case NeedMatType.IncreaseItem:
                case NeedMatType.fixedItem:
                    if (itemConfig.GetWay != null && itemConfig.GetWay.Length > 0)
                    {
                        pathModel.SetChinItemModel(itemId);
                        return;
                    }
                    break;
            }
            if (itemModel == null)
            {
                attrData = new ItemAttrData(itemId, true);
                tipsModel.SetItemTipsModel(attrData);
            }
            else
            {
                tipsModel.SetItemTipsModel(PackType.rptItem, itemModel.itemInfo.ItemGUID);
            }
        }
        private void ClickSelect()
        {
            selectModel.SetSelectMatCell(this);
            switch (matType)
            {
                case NeedMatType.unfixedItem:
                    selectModel.selectItem = SelectItemType.unfixed;
                    break;
                case NeedMatType.addItem:
                    selectModel.selectItem = SelectItemType.addons;
                    break;
            }
            WindowCenter.Instance.Open<SelectItemWin>();
        }
    }
}
System/Compose/New/ComposeMatCell.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6d59af90cb074074fb174ee6e6922276
timeCreated: 1541577702
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Compose/New/ComposeTicketWin.cs
@@ -10,50 +10,32 @@
{
    public class ComposeTicketWin : Window
    {
        [SerializeField]
        GameObject composeUIShowObj;
        [SerializeField]
        GameObject noneComposeObj;
        [SerializeField]
        ScrollerController cellCtrl;
        [SerializeField]
        List<GameObject> sourceItemlist = new List<GameObject>();
        [SerializeField]
        List<GameObject> previewItemlist = new List<GameObject>();
        [SerializeField]
        Text successRateText;
        [SerializeField]
        Text _moneyCountText;
        [SerializeField] ScrollerController cellCtrl;
        [SerializeField] GameObject containCompose;
        [SerializeField] GameObject containUnCompose;
        [SerializeField] GameObject containOneMat;
        [SerializeField] GameObject containTwoMat;
        [SerializeField] Text successRateText;
        [SerializeField] Text _moneyCountText;
        [SerializeField] GameObject costMoneyObj;
        [SerializeField]
        Button composeBtn;
        [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>();
        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
        {
@@ -67,34 +49,21 @@
            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;
        private int curSecondType = 0;
        private int curThirdType = 0;
        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()
        {
            cellCtrl.OnRefreshCell += RefreshCell;
            cellCtrl.OnRefreshCell += RefreshTypeCell;
            cellCtrl.vertical = true;
            cellCtrl.lockType = EnhanceLockType.KeepVertical;
            composeWinModel.ResetModelEvent += ResetModel;
@@ -110,53 +79,133 @@
        protected override void OnPreOpen()
        {
            DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
            firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Ticket);
            composeWinModel.UpdateSecondTypeEvent += UpdateSecondType;
            composeWinModel.UpdateThirdTypeEvent += UpdateThirdType;
            Display();
            //firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Ticket);
            //bool isJumpTo = false;
            //if (AchievementGoto.guideAchievementId != 0)
            //{
            //    SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
            //    if (successConfig.Type == 69)
            //    {
            //        isJumpTo = true;
            //        curSecondType = composeWinModel.secondType;
            //        curThirdType = composeWinModel.thirdType;
            //        secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, composeWinModel.secondType);
            //        ClickSecondTypeUICtrl();
            //        composeWinModel.ResetJumpToModel();
            //    }
            //}
            //else
            //{
            //    if(composeWinModel.secondType != 0)
            //    {
            //        isJumpTo = true;
            //        curSecondType = composeWinModel.secondType;
            //        curThirdType = composeWinModel.thirdType;
            //        secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket,composeWinModel.secondType);
            //        ClickSecondTypeUICtrl();
            //        composeWinModel.ResetJumpToModel();
            //    }
            //}
            //CreateCell();
            //if (curSecondType == 0)
            //{
            //    RefreshUI(null);
            //}
            //if (compoundModel != null)
            //{
            //    RefreshUI(compoundModel);
            //    if (isJumpTo)
            //    {
            //        isJumpTo = false;
            //        bool isCanCompose = true;
            //        if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
            //        {
            //            MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
            //            isCanCompose = false;
            //        }
            //        else if (!composeWinModel.IsEnoughMoney(compoundModel))
            //        {
            //            MessageWin.Inst.ShowFixedTip(Language.Get("Z1011"));
            //            isCanCompose = false;
            //        }
            //        if (isCanCompose)
            //        {
            //            guidEffect = AchievementGuideEffectPool.Require(1);
            //            guidEffect.transform.SetParentEx(composeBtn.transform, Vector3.zero, Quaternion.identity, Vector3.one);
            //        }
            //    }
            //}
        }
        protected override void OnAfterOpen()
        {
            cellCtrl.vertical = true;
            this.transform.SetAsLastSibling();
        }
        protected override void OnPreClose()
        {
            composeWinModel.UpdateSecondTypeEvent -= UpdateSecondType;
            composeWinModel.UpdateThirdTypeEvent -= UpdateThirdType;
            DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnComposeAnswer;
        }
        protected override void OnAfterClose()
        {
        }
        #region 新的逻辑
        private void Display()
        {
            composeWinModel.TryGetFirstTypeData((int)ComposeFuncType.Ticket, out firstTypeData);
            if (firstTypeData == null) return;
            DefaultSelect();
            CreateTypeCell();
            JumpIndex();
        }
        private void DefaultSelect()
        {
            bool isJumpTo = false;
            if (AchievementGoto.guideAchievementId != 0)
            var achieveId = AchievementGoto.guideAchievementId;
            SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(achieveId);
            if(successConfig != null && successConfig.Type == 69)
            {
                SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
                if (successConfig.Type == 69)
                {
                    isJumpTo = true;
                    curSecondType = composeWinModel.secondType;
                    curThirdType = composeWinModel.thirdType;
                    secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, composeWinModel.secondType);
                    ClickSecondTypeUICtrl();
                    composeWinModel.ResetJumpToModel();
                }
                isJumpTo = true;
                curSecondType = composeWinModel.secondType;
                curThirdType = composeWinModel.thirdType;
                composeWinModel.ResetJumpToModel();
            }
            else
            {
                if(composeWinModel.secondType != 0)
                if (composeWinModel.secondType != 0)
                {
                    isJumpTo = true;
                    curSecondType = composeWinModel.secondType;
                    curThirdType = composeWinModel.thirdType;
                    secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket,composeWinModel.secondType);
                    ClickSecondTypeUICtrl();
                    composeWinModel.ResetJumpToModel();
                }
            }
            CreateCell();
            if (curSecondType == 0)
            composeWinModel.TryGetThirdTypeData((int)ComposeFuncType.Ticket, curSecondType, curThirdType, out thirdTypeData);
            if (thirdTypeData != null)
            {
                RefreshUI(null);
            }
            if (compoundModel != null)
            {
                RefreshUI(compoundModel);
                RefreshUI(thirdTypeData.itemCompound);
                if (isJumpTo)
                {
                    isJumpTo = false;
                    bool isCanCompose = true;
                    if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
                    if (!composeWinModel.IsEnoughFixedMat(thirdTypeData.itemCompound) || !composeWinModel.IsEnoughUnfixedMat(thirdTypeData.itemCompound))
                    {
                        MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
                        isCanCompose = false;
                    }
                    else if (!composeWinModel.IsEnoughMoney(compoundModel))
                    else if (!composeWinModel.IsEnoughMoney(thirdTypeData.itemCompound))
                    {
                        MessageWin.Inst.ShowFixedTip(Language.Get("Z1011"));
                        isCanCompose = false;
@@ -169,68 +218,91 @@
                    }
                }
            }
        }
        protected override void OnAfterOpen()
        {
            cellCtrl.vertical = true;
            this.transform.SetAsLastSibling();
        }
        protected override void OnPreClose()
        {
            DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnComposeAnswer;
        }
        protected override void OnAfterClose()
        {
        }
        private void ResetModel()
        {
            curSecondType = 0;
            curThirdType = 0;
            preSecondType = 0;
            compoundModel = null;
        }
        private void CreateCell()
        {
            cellCtrl.Refresh();
            if(firstTypeDict != null)
            else
            {
                foreach (int secondType in firstTypeDict.Keys)
                RefreshUI(null);
            }
        }
        private void CreateTypeCell()
        {
            if (firstTypeData == null) return;
            cellCtrl.Refresh();
            foreach (var second in firstTypeData.secondTypeDict.Keys)
            {
                cellCtrl.AddCell(ScrollerDataType.Header, second);
                if (second == curSecondType)
                {
                    cellCtrl.AddCell(ScrollerDataType.Header,secondType);
                    if(secondType == curSecondType)
                    var thirdTypeDict = firstTypeData.secondTypeDict[second].thirdTypeDict;
                    foreach (var third in thirdTypeDict.Keys)
                    {
                        foreach (int thirdType in firstTypeDict[secondType].Keys)
                        if (third != 0)
                        {
                            if (thirdType != 0)
                            {
                                cellCtrl.AddCell(ScrollerDataType.Normal, thirdType);
                            }
                            cellCtrl.AddCell(ScrollerDataType.Normal, third);
                        }
                    }
                }
            }
            cellCtrl.Restart();
            if (secondTypeDict != null)
            if (curSecondType != 0)
            {
                if (secondTypeDict.Count >= 1 && curSecondType != 0)
                composeWinModel.TryGetThirdTypeData((int)ComposeFuncType.Ticket, curSecondType, curThirdType, out thirdTypeData);
                if (thirdTypeData != null)
                {
                    cellCtrl.JumpIndex(GetCurIndex(curSecondType));
                    var fixItemIds = thirdTypeData.itemCompound.itemID;
                    if(fixItemIds != null)
                    {
                        if(fixItemIds.Length < 2)
                        {
                            UpdateUIShow(true,false,true,false);
                        }
                        else
                        {
                            UpdateUIShow(true, false, false, true);
                        }
                    }
                    RefreshUI(thirdTypeData.itemCompound);
                }
                else
                {
                    RefreshUI(null);
                    UpdateUIShow(false, true, false, false);
                }
            }
            else
            {
                RefreshUI(null);
                UpdateUIShow(false,true, false,false);
            }
        }
        private void UpdateUIShow(params bool[] isShows)
        {
            containCompose.SetActive(isShows[0]);
            containUnCompose.SetActive(isShows[1]);
            containOneMat.SetActive(isShows[2]);
            containTwoMat.SetActive(isShows[3]);
        }
        private void JumpIndex()
        {
            if (firstTypeData == null) return;
            var secondTypeDict = firstTypeData.secondTypeDict;
            if (secondTypeDict.Count >= 1 && curSecondType != 0)
            {
                cellCtrl.JumpIndex(GetCurIndex(curSecondType));
            }
        }
        private int GetCurIndex(int secondType)
        {
            if (firstTypeData == null) return 0;
            int curIndex = 0;
            List<int> secondlist = firstTypeDict.Keys.ToList();
            var secondTypeDict = firstTypeData.secondTypeDict;
            List<int> secondlist = secondTypeDict.Keys.ToList();
            for (int i = 0; i < secondlist.Count; i++)
            {
                if (secondType == secondlist[i])
@@ -241,81 +313,73 @@
            }
            return curIndex;
        }
        private void RefreshCell(ScrollerDataType type, CellView cell)
        private void RefreshTypeCell(ScrollerDataType type, CellView cell)
        {
            Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();
            Text name = cell.transform.Find("BtnText").GetComponent<Text>();
            Button cellBtn = cell.GetComponent<Button>();
            cellBtn.RemoveAllListeners();
            ItemCompoundConfig compoundModel = null;
            switch (type)
            {
                case ScrollerDataType.Header:
                    GameObject arrowIcon = cell.transform.Find("SecondBtn").gameObject;
                    foreach (int thirdType in firstTypeDict[cell.index].Keys)
                    ComposeWinModel.ComposeSecondTypeData _secondTypeData = null;
                    ComposeFirstTypeCell firstTypeCell = cell.GetComponent<ComposeFirstTypeCell>();
                    composeWinModel.TryGetSecondTypeData((int)ComposeFuncType.Ticket, cell.index, out _secondTypeData);
                    if (_secondTypeData != null)
                    {
                        if (thirdType != 0)
                        var thirdTypeDict = _secondTypeData.thirdTypeDict;
                        foreach (var third in thirdTypeDict.Keys)
                        {
                            arrowIcon.SetActive(true);
                            ComposeWinModel.ComposeThirdTypeData thirdTypeData = null;
                            composeWinModel.TryGetThirdTypeData((int)ComposeFuncType.Ticket, cell.index, third, out thirdTypeData);
                            firstTypeCell.SetDisplay((int)ComposeFuncType.Ticket, cell.index, third, curSecondType);
                            break;
                        }
                        else
                        {
                            arrowIcon.SetActive(false);
                        }
                        compoundModel = firstTypeDict[cell.index][thirdType][0];
                        name.text = compoundModel.secondTypeName;
                        if (curSecondType == cell.index)
                        {
                            preSecondType = curSecondType;
                            arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
                            icon.SetSprite("ComposeFirstClassChoosebtn");
                            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
                            //ClickSecondTypeUICtrl();
                        }
                        else
                        {
                            arrowIcon.transform.localRotation = Quaternion.Euler(0, 0,0);
                            icon.SetSprite("ComposeFirstClassNormalbtn");
                        }
                        break;
                    }
                    cellBtn.AddListener(()=> { OnClickSecondType(cell.index); });
                    break;
                case ScrollerDataType.Normal:
                    compoundModel = secondTypeDict[cell.index][0];
                    name.text = compoundModel.thirdTypeName;
                    ComposeSecondTypeCell secondTypeCell = cell.GetComponent<ComposeSecondTypeCell>();
                    secondTypeCell.SetDisplay((int)ComposeFuncType.Ticket, curSecondType, cell.index, curThirdType);
                    if (curThirdType == cell.index)
                    {
                        icon.SetSprite("ChildListBtn_Select");
                        thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
                        RefreshUI(compoundModel);
                        ComposeWinModel.ComposeThirdTypeData thirdTypeData = null;
                        composeWinModel.TryGetThirdTypeData((int)ComposeFuncType.Ticket, curSecondType, cell.index,out thirdTypeData);
                        RefreshUI(thirdTypeData.itemCompound);
                    }
                    else
                    {
                        icon.SetSprite("ChildListBtn_UnSelect");
                    }
                    cellBtn.AddListener(() => { OnClickThirdType(cell.index); });
                    break;
            }
        }
        private void OnClickSecondType(int secondType)
        private void UpdateSecondType(int secondType)
        {
            curThirdType = 0;
            curSecondType = secondType;
            secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
            foreach (var thirdType in secondTypeDict.Keys)
            composeWinModel.TryGetSecondTypeData((int)ComposeFuncType.Ticket, secondType, out secondTypeData);
            OnClickSecondType();
            CreateTypeCell();
            JumpIndex();
        }
        private void OnClickSecondType()
        {
            if (secondTypeData == null) return;
            var thirdTypeDict = secondTypeData.thirdTypeDict;
            if (curThirdType == 0)
            {
                if (thirdType != 0)
                foreach (var thirdType in thirdTypeDict.Keys)
                {
                    if (preSecondType == curSecondType)
                    if (thirdType != 0)
                    {
                        curSecondType = 0;
                        preSecondType = 0;
                        if (preSecondType == curSecondType)
                        {
                            curSecondType = 0;
                            preSecondType = 0;
                        }
                        else
                        {
                            curThirdType = thirdType;
                        }
                    }
                    break;
                }
                curThirdType = 0;
                break;
            }
            if (preSecondType != curSecondType)
@@ -327,234 +391,165 @@
                    guidEffect = null;
                }
            }
            ClickSecondTypeUICtrl();
            CreateCell();
        }
        private void ClickSecondTypeUICtrl()
        private void UpdateThirdType(int thirdType)
        {
            if (secondTypeDict.Count > 1)
            composeWinModel.TryGetThirdTypeData((int)ComposeFuncType.Ticket, curSecondType, thirdType, out thirdTypeData);
            if (thirdTypeData != null)
            {
                RefreshUI(null);
            }
            else
            {
                if (secondTypeDict.ContainsKey(curThirdType))
                bool isTrailer = composeWinModel.IsTrailerByLevel(thirdTypeData.itemCompound);
                if (isTrailer)
                {
                    RefreshUI(secondTypeDict[curThirdType][0]);
                    MessageWin.Inst.ShowFixedTip(Language.Get("FuncOpenLv", thirdTypeData.itemCompound.levelNeed));
                    return;
                }
            }
            curThirdType = thirdType;
            CreateTypeCell();
        }
        private void OnClickThirdType(int thirdType)
        private void UpdateComposeMat()
        {
            curThirdType = thirdType;
            cellCtrl.m_Scorller.RefreshActiveCellViews();
            int[] makeIds = compoundModel.makeID;
            for (int i = 0; i < makeItems.Count; i++)
            {
                var matCell = makeItems[i];
                if(makeIds != null && i < makeIds.Length)
                {
                    matCell.SetDisplay(compoundModel, NeedMatType.MakeItem,false,"",makeIds[i]);
                }
                else
                {
                    matCell.SetDisplay(compoundModel, NeedMatType.MakeItem,true);
                }
            }
            int[] fixedIds = compoundModel.itemID;
            int[] fixedDisplays = compoundModel.itemDisplay;
            int[] unfixedIds = compoundModel.unfixedItemID;
            int[] unfixedDisplays = compoundModel.unfixedItemDisplay;
            if(fixedIds != null && fixedIds.Length < 2)
            {
                for (int i = 0; i < oneMatFixedAndUnfixeds.Count; i++)
                {
                    var matCell = oneMatFixedAndUnfixeds[i];
                    var fixedDisplay = 0;
                    var unfixedDisplay = 0;
                    if (i < fixedDisplays.Length)
                    {
                        fixedDisplay = fixedDisplays[i];
                    }
                    else
                    {
                        int unfixedIndex = i - fixedDisplays.Length;
                        if (unfixedIndex < unfixedDisplays.Length)
                        {
                            unfixedDisplay = unfixedDisplays[unfixedIndex];
                        }
                    }
                    if (fixedDisplays != null
                        && fixedDisplay != 0
                        && fixedDisplays.Contains(fixedDisplay))
                    {
                        int fixedId = 0;
                        composeWinModel.TryGetIdByDisplay(NeedMatType.fixedItem, compoundModel, fixedDisplay, out fixedId);
                        matCell.SetDisplay(compoundModel, NeedMatType.fixedItem, false, "", fixedId);
                    }
                    else if (unfixedDisplays != null
                        && unfixedDisplay != 0
                        && unfixedDisplays.Contains(unfixedDisplay))
                    {
                        matCell.SetDisplay(compoundModel, NeedMatType.unfixedItem, false);
                    }
                    else
                    {
                        matCell.SetDisplay(compoundModel, NeedMatType.Nothing, true);
                    }
                }
            }
            else if(fixedIds != null)
            {
                for (int i = 0; i < twoMatFixedAndUnfixeds.Count; i++)
                {
                    var matCell = twoMatFixedAndUnfixeds[i];
                    var fixedDisplay = 0;
                    var unfixedDisplay = 0;
                    if (i < fixedDisplays.Length)
                    {
                        fixedDisplay = fixedDisplays[i];
                    }
                    else
                    {
                        int unfixedIndex = i - fixedDisplays.Length;
                        if (unfixedIndex < unfixedDisplays.Length)
                        {
                            unfixedDisplay = unfixedDisplays[unfixedIndex];
                        }
                    }
                    if (fixedDisplays != null
                        && fixedDisplay != 0
                        && fixedDisplays.Contains(fixedDisplay))
                    {
                        int fixedId = 0;
                        composeWinModel.TryGetIdByDisplay(NeedMatType.fixedItem, compoundModel, fixedDisplay, out fixedId);
                        matCell.SetDisplay(compoundModel, NeedMatType.fixedItem, false, "", fixedId);
                    }
                    else if (unfixedDisplays != null
                        && unfixedDisplay != 0
                        && unfixedDisplays.Contains(unfixedDisplay))
                    {
                        matCell.SetDisplay(compoundModel, NeedMatType.unfixedItem, false);
                    }
                    else
                    {
                        matCell.SetDisplay(compoundModel, NeedMatType.Nothing, true);
                    }
                }
            }
            _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()
        {
            curSecondType = 0;
            curThirdType = 0;
            preSecondType = 0;
            compoundModel = null;
        }
        private void RefreshUI(ItemCompoundConfig compoundModel)
        {
            this.compoundModel = compoundModel;
            if (compoundModel == null)
            {
                noneComposeObj.SetActive(true);
                composeUIShowObj.SetActive(false);
            }
            else
            {
                noneComposeObj.SetActive(false);
                composeUIShowObj.SetActive(true);
                successRateText.text = Language.Get("HallowsWin_Success", StringUtility.Contact(compoundModel.successRate / 100, "%"));
                composeWinModel.SetCurComposeModel(compoundModel);
                ControllerRightUI();
            }
            if (compoundModel == null) return;
            successRateText.text = Language.Get("HallowsWin_Success", StringUtility.Contact(compoundModel.successRate / 100, "%"));
            composeWinModel.SetCurComposeModel(compoundModel);
            UpdateComposeMat();
        }
        private void ControllerRightUI()
        {
            int i = 0;
            #region 合成物品UI
            for (i = 0; i < previewItemlist.Count; i++)
            {
                int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.MakeIds);
                GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
                if (i < makeIds.Length)
                {
                    RefreshGridCellUI(gridCell, false,makeIds[i],NeedMatType.MakeItem);
                }
                else
                {
                    RefreshGridCellUI(gridCell,true);
                }
            }
            #endregion
            #region 固定道具和不固定道具UI
            int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
            int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedIds);
            int[] unfixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.UnfixedDisplay);
            for (i = 0;i < sourceItemlist.Count; i++)
            {
                GameObject gridCell = sourceItemlist[i].transform.Find("GridCell").gameObject;
                Text putInText = sourceItemlist[i].transform.Find("PutInText").GetComponent<Text>();
                Button posBtn = sourceItemlist[i].GetComponent<Button>();
                putInText.gameObject.SetActive(false);
                RefreshGridCellUI(gridCell, true);
                posBtn.RemoveAllListeners();
            }
            for (i = 0; i < fixedDisplay.Length; i++)
            {
                if (fixedDisplay[i] != 0)
                {
                    GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
                    GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
                    Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
                    putInText.gameObject.SetActive(false);
                    RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
                }
            }
            for (i = 0; i < unfixedDisplay.Length; i++)
            {
                if (unfixedDisplay[i] != 0)
                {
                    GameObject matPos = sourceItemlist[unfixedDisplay[i] - 1];
                    GameObject gridCell = matPos.transform.Find("GridCell").gameObject;
                    Text putInText = matPos.transform.Find("PutInText").GetComponent<Text>();
                    Button posBtn = matPos.GetComponent<Button>();
                    putInText.gameObject.SetActive(true);
                    RefreshGridCellUI(gridCell, false);
                    posBtn.RemoveAllListeners();
                    posBtn.AddListener(() => {
                        selectModel.SetAddParent(matPos);
                        selectModel.selectItem = SelectItemType.unfixed;
                        WindowCenter.Instance.Open<SelectItemWin>();
                    });
                }
            }
            #endregion
            _moneyCountText.text = modelInterface.OnChangeCoinsUnit((ulong)compoundModel.money);
        }
        private void RefreshGridCellUI(GameObject gridCell, bool islock, int itemId = -1,NeedMatType matType = NeedMatType.unfixedItem,int itemPlace = -1)
        {
            gridCell.SetActive(true);
            ItemCell itemCell = gridCell.transform.Find("ItemCell").GetComponent<ItemCell>();
            if (itemCell == null)
                itemCell = gridCell.transform.Find("ItemCell").gameObject.AddComponent<ItemCell>();
            GameObject gridlock = gridCell.transform.Find("GridLock").gameObject;
            itemCell.cellBtn.onClick.RemoveAllListeners();
            if (islock)
            {
                gridlock.gameObject.SetActive(true);
                itemCell.gameObject.SetActive(false);
            }
            else
            {
                gridlock.gameObject.SetActive(false);
                itemCell.gameObject.SetActive(true);
                ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptItem,itemPlace);
                ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemId);
                if (itemModel == null)
                {
                    if(itemId != -1)
                    {
                        ItemCellModel cellModel = new ItemCellModel(itemId);
                        itemCell.Init(cellModel);
                        itemCell.cellBtn.onClick.AddListener(() =>
                        {
                            if (matType == NeedMatType.fixedItem)
                            {
                                if (itemConfig.GetWay != null && itemConfig.GetWay.Length > 0)
                                {
                                    ItemPathModel.SetChinItemModel(itemId);
                                }
                                else
                                {
                                    ItemAttrData attrData = new ItemAttrData(itemId, true);
                                    itemTipsModel.SetItemTipsModel(attrData);
                                }
                            }
                            else
                            {
                                ItemAttrData attrData = new ItemAttrData(itemId, true);
                                itemTipsModel.SetItemTipsModel(attrData);
                            }
                        }
                        );
                    }
                    else
                    {
                        itemCell.gameObject.SetActive(false);
                    }
                }
                else
                {
                    itemCell.Init(itemModel);
                    itemCell.cellBtn.onClick.AddListener(() =>
                    {
                        if (matType == NeedMatType.fixedItem)
                        {
                            if (itemConfig.GetWay != null && itemConfig.GetWay.Length > 0)
                            {
                                ItemPathModel.SetChinItemModel(itemId);
                            }
                            else
                            {
                                itemTipsModel.SetItemTipsModel(PackType.rptItem, itemModel.itemInfo.ItemGUID);
                            }
                        }
                        else
                        {
                            itemTipsModel.SetItemTipsModel(PackType.rptItem, itemModel.itemInfo.ItemGUID);
                        }
                    });
                }
                if(matType == NeedMatType.fixedItem)
                {
                    int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
                    int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
                    itemCell.countText.gameObject.SetActive(true);
                    int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
                    int i = 0;
                    for(i = 0; i < fixedIds.Length; i++)
                    {
                        if(fixedIds[i] == itemId)
                        {
                            if (haveCount >= fixedCounts[i])
                            {
                                itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
                                    "/",fixedCounts[i].ToString());
                            }
                            else
                            {
                                itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
                                    "/", fixedCounts[i].ToString());
                            }
                            break;
                        }
                    }
                }
                else
                {
                    itemCell.countText.gameObject.SetActive(false);
                }
            }
        }
        private void ClickAllComposeBtn()
        {
            fixedItemIndexDict.Clear();
@@ -562,8 +557,8 @@
            List<int> composeCountlist = new List<int>();
            SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
            int[] fixedIds = compoundModel.itemID;
            int[] fixedCounts = compoundModel.itemCount;
            for (int i = 0; i < fixedIds.Length; i++)
            {
                int haveCount = playerPack.GetItemCountByID(PackType.rptItem, fixedIds[i]);
@@ -588,7 +583,7 @@
                    break;
                }
            }
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCnt);
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,GetPlayMatEffect(), composeCnt);
        }
        private void OnClickComposeBtn()
@@ -596,7 +591,7 @@
            if (compoundModel == null) return;
            SetFixedItemIndexDic();
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
            composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,GetPlayMatEffect(),1);
        }
        private void SetFixedItemIndexDic()
@@ -608,8 +603,8 @@
            int minBindCnt = 0;
            int minNoBindCnt = 0;
            composeWinModel.GetBindOrNoBindMinCnt(out minBindCnt,out minNoBindCnt);
            int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
            int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
            int[] fixedIds = compoundModel.itemID;
            int[] fixedCounts = compoundModel.itemCount;
            for (int i = 0; i < fixedIds.Length; i++)
            {
@@ -651,7 +646,6 @@
            }
            RefreshUI(compoundModel);
            selectModel.ClearSelectModel();
        }
    }
}
System/Compose/New/ComposeWinModel.cs
@@ -186,6 +186,7 @@
    {
        public int thirdType;
        public ItemCompoundConfig itemCompound = null;
    }
    #endregion
@@ -298,6 +299,66 @@
        indexlist = singlePack.ItemIndexlist(increases[0], increases[1]);
        return true;
    }
    public bool TryGetCountById(NeedMatType matType,ItemCompoundConfig itemCompound,int itemId,out int itemCount)
    {
        itemCount = 0;
        if (itemCompound == null || itemId == 0) return false;
        switch (matType)
        {
            case NeedMatType.IncreaseItem:
                int[] increases = itemCompound.successRateIncrease;
                if (increases != null && increases.Length >= 3)
                {
                    itemCount = increases[1];
                    return true;
                }
                break;
            case NeedMatType.fixedItem:
                int[] fixedIds = itemCompound.itemID;
                int[] fixedCounts = itemCompound.itemCount;
                int[] fixedDisplays = itemCompound.itemDisplay;
                if (fixedIds != null)
                {
                    for (int i = 0; i < fixedIds.Length; i++)
                    {
                        if (fixedIds[i] == itemId)
                        {
                            itemCount = fixedCounts[i];
                            return true;
                        }
                    }
                }
                break;
        }
        return false;
    }
    public bool TryGetIdByDisplay(NeedMatType matType, ItemCompoundConfig itemCompound, int display, out int itemId)
    {
        itemId = 0;
        if (itemCompound == null || display == 0) return false;
        switch (matType)
        {
            case NeedMatType.fixedItem:
                int[] fixedIds = itemCompound.itemID;
                int[] fixedDisplays = itemCompound.itemDisplay;
                if (fixedDisplays != null)
                {
                    for (int i = 0; i < fixedDisplays.Length; i++)
                    {
                        if (fixedDisplays[i] == display)
                        {
                            itemId = fixedIds[i];
                            return true;
                        }
                    }
                }
                break;
        }
        return false;
    }
    #endregion
    public bool IsComposeJobLimit(int composeId)
System/Compose/New/SelectEquipModel.cs
@@ -35,7 +35,6 @@
    PackModelInterface modelInterface { get { return ModelCenter.Instance.GetModel<PackModelInterface>(); } }
    public event Action haveSelectItemRefresh;
    public int[] extraOneKeyPutCondis;
    public int[] noOneKeyPutCondis;
    public override void Init()
@@ -199,11 +198,6 @@
        {
            haveUnfixedSelectItemDic.Add(itemPlace, itemModel);
        }
        if (haveSelectItemRefresh != null)
        {
            haveSelectItemRefresh();
        }
    }
    public void RemoveHaveUnfixedSelectItem(int itemPlace)
@@ -211,11 +205,6 @@
        if (haveUnfixedSelectItemDic.ContainsKey(itemPlace))
        {
            haveUnfixedSelectItemDic.Remove(itemPlace);
        }
        if (haveSelectItemRefresh != null)
        {
            haveSelectItemRefresh();
        }
    }
@@ -226,11 +215,6 @@
        {
            haveAddSelectItemDic.Add(itemPlace, itemModel);
        }
        if (haveSelectItemRefresh != null)
        {
            haveSelectItemRefresh();
        }
    }
    public void RemoveHaveAddSelectItem(int itemPlace)
@@ -238,11 +222,6 @@
        if (haveAddSelectItemDic.ContainsKey(itemPlace))
        {
            haveAddSelectItemDic.Remove(itemPlace);
        }
        if (haveSelectItemRefresh != null)
        {
            haveSelectItemRefresh();
        }
    }
@@ -253,7 +232,6 @@
    }
    public event Action<ItemModel, GameObject,SelectItemType> selectEquipEvent;
    public void RefreshSelectEquip(ItemModel model)
    {
        if (selectEquipEvent != null)
@@ -262,15 +240,26 @@
        }
    }
    public event Action<ComposeMatCell,int, SelectItemType> UpdateSelectEvent;
    public ComposeMatCell selectMatCell { get; private set; }
    public void SetSelectMatCell(ComposeMatCell matCell)
    {
        selectMatCell = matCell;
    }
    public void UpdateSelectItem(int itemIndex)
    {
        if (UpdateSelectEvent != null)
        {
            UpdateSelectEvent(selectMatCell,itemIndex,selectItem);
        }
    }
    public void ClearSelectModel()
    {
        selectMatCell = null;
        addParent = null;
        haveAddSelectItemDic.Clear();
        haveUnfixedSelectItemDic.Clear();
        if(haveSelectItemRefresh != null)
        {
            haveSelectItemRefresh();
        }
    }
    public Dictionary<int, ItemModel> GetHaveUnfixedSelectItem()
System/Compose/New/SelectItemWin.cs
@@ -102,6 +102,7 @@
                break;
        }
        selectModel.RefreshSelectEquip(itemModel);
        selectModel.UpdateSelectItem(itemModel.itemInfo.ItemPlace);
        CloseWin();
    }