Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | {
|
| | | Config.Instance.PreLoadConfigs();
|
| | | ServerListCenter.Instance.RequestJumpUrl();
|
| | | WindowCenter.Instance.OpenFromLocal<LaunchBackGroundWin>();
|
| | |
|
| | | WindowCenter.Instance.OpenFromLocal<LaunchWin>();
|
| | | DebugUtility.Instance.CreateDebugRoot();
|
| | |
|
| | |
| | |
|
| | | UI3DModelExhibition.CreateStage();
|
| | |
|
| | | var launchWin = WindowCenter.Instance.Get<LaunchWin>();
|
| | | if (launchWin != null)
|
| | | {
|
| | | launchWin.FadeOut();
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
|
| | | var launchBackGroundWin = WindowCenter.Instance.Get<LaunchBackGroundWin>();
|
| | | launchBackGroundWin.transform.SetAsFirstSibling();
|
| | |
|
| | | progressBuf = progress;
|
| | | timer = 0f;
|
| | | duration = 1f;
|
| | |
| | | {
|
| | | private static Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>> allComposeModelDict = new Dictionary<int, Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>>>();
|
| | | static Dictionary<int, List<ItemCompoundConfig>> ticketComposeDict = new Dictionary<int, List<ItemCompoundConfig>>();
|
| | | static Dictionary<int, Dictionary<DisplayItemArray, int[]>> displayItemDict = new Dictionary<int, Dictionary<DisplayItemArray, int[]>>();
|
| | | public void OnConfigParseCompleted()
|
| | | {
|
| | | if (!allComposeModelDict.ContainsKey(firstType))
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | int[] makeIDs = ConfigParse.GetMultipleStr<int>(makeID);
|
| | | int[] unfixedItemIDs = ConfigParse.GetMultipleStr<int>(unfixedItemID);
|
| | | int[] fixedItemIDs = ConfigParse.GetMultipleStr<int>(itemID);
|
| | | int[] fixedItemCounts = ConfigParse.GetMultipleStr<int>(itemCount);
|
| | | int[] unfixedDisplay = ConfigParse.GetMultipleStr<int>(unfixedItemDisplay);
|
| | | int[] fixedDisplay = ConfigParse.GetMultipleStr<int>(itemDisplay);
|
| | |
|
| | | if (!displayItemDict.ContainsKey(id))
|
| | | {
|
| | | Dictionary<DisplayItemArray, int[]> arrayDict = new Dictionary<DisplayItemArray, int[]>();
|
| | | arrayDict.Add(DisplayItemArray.MakeIds,makeIDs);
|
| | | arrayDict.Add(DisplayItemArray.UnfixedIds,unfixedItemIDs);
|
| | | arrayDict.Add(DisplayItemArray.UnfixedDisplay,unfixedDisplay);
|
| | | arrayDict.Add(DisplayItemArray.FixedIds,fixedItemIDs);
|
| | | arrayDict.Add(DisplayItemArray.FixedCounts, fixedItemCounts);
|
| | | arrayDict.Add(DisplayItemArray.FixedDisplay,fixedDisplay);
|
| | | displayItemDict.Add(id, arrayDict);
|
| | | }
|
| | |
|
| | | if (firstType == (int)ComposeFuncType.Ticket)
|
| | |
| | | return ticketComposeDict.TryGetValue(_ticketId, out list);
|
| | | }
|
| | |
|
| | | public static int[] GetDisplayArrayByType(int id,DisplayItemArray display)
|
| | | {
|
| | | int[] array = null;
|
| | | if(displayItemDict.ContainsKey(id))
|
| | | {
|
| | | displayItemDict[id].TryGetValue(display,out array);
|
| | | }
|
| | | return array;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | _cTarget.DoFlashWhite();
|
| | | }
|
| | |
|
| | | if (_sTarget.CurHP == 0)
|
| | | // 2018年8月28日 20:11:06 角色有可能具有死而复生的能力 这里不在血量为0的时候调用死亡逻辑
|
| | | if (_sTarget.CurHP == 0 && !(_cTarget is GActorPlayerBase))
|
| | | {
|
| | | _cTarget.ActorInfo.ResetHp((int)_sTarget.CurHP, (short)_sTarget.CurHPEx);
|
| | | _cTarget.Die(vNetData.ObjID);
|
| | |
| | | GAStaticDefine.PopHp(_attacker, _cTarget, _sTarget.AttackType, (int)_sTarget.HurtHP);
|
| | | }
|
| | |
|
| | | if (_sTarget.CurHP == 0)
|
| | | // 2018年8月28日 20:11:06 角色有可能具有死而复生的能力 这里不在血量为0的时候调用死亡逻辑
|
| | | if (_sTarget.CurHP == 0 && !(_cTarget is GActorPlayerBase))
|
| | | {
|
| | | _cTarget.ActorInfo.ResetHp((int)_sTarget.CurHP, (short)_sTarget.CurHPEx);
|
| | | _cTarget.Die(vNetData.ObjID);
|
| | |
| | |
|
| | | protected bool WaitForPickup()
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | DropItemManager.DropObject _obj = null;
|
| | | if (DropItemManager.HandupTryGetHeroItem(out _obj))
|
| | | {
|
| | | bool _needPickupSelf = true;
|
| | |
|
| | | // 有掉落物
|
| | | // 是否是强制守护不能拾取的
|
| | | if (_obj.ownerType != 7)
|
| | | {
|
| | | if (Config.Instance.ContainKey<DungeonOpenTimeConfig>(PlayerDatas.Instance.baseData.MapID)) // 是副本
|
| | | {
|
| | | var _dungeonOpenTime = Config.Instance.Get<DungeonOpenTimeConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | |
| | | if (_itemModel != null // 有守护
|
| | | && GeneralConfig.Instance.GuardianPickUpID.Contains(_itemModel.itemId))// 守护有拾取功能
|
| | | {
|
| | | return false;
|
| | | _needPickupSelf = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (_itemModel != null // 有守护
|
| | | && GeneralConfig.Instance.GuardianPickUpID.Contains(_itemModel.itemId))// 守护有拾取功能
|
| | | {
|
| | | return false;
|
| | | _needPickupSelf = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | DropItemManager.DropObject _obj = null;
|
| | | if (DropItemManager.HandupTryGetHeroItem(out _obj))
|
| | | if (_needPickupSelf)
|
| | | {
|
| | | _hero.StopRush();
|
| | | Vector3 _targetPosition = _obj.dropItem.transform.position;
|
| | |
| | | }
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | return false;
|
| | | }
|
| | | }
|
| | | else if (dropObject.ownerType == 7)
|
| | | {
|
| | | if (dropObject.ownerID != PlayerDatas.Instance.baseData.Family)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | ItemConfig _itemModel = Config.Instance.Get<ItemConfig>(dropObject.itemID);
|
| | |
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | // 如果是仙盟归属的, 设定为守护不拾取
|
| | | if (_item.ownerType == 7)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | return CheckCanPickUp(_item);
|
| | | }
|
| | | #endregion
|
| | |
| | | UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
|
| | | UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
|
| | | successRate = 0;
|
| | | composeWinModel.funcType = ComposeFuncType.MountDogz;
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel();
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.MountDogz);
|
| | | CreateCell();
|
| | | if(curSecondType == 0)
|
| | | {
|
| | |
| | | {
|
| | | arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
|
| | | icon.SetSprite("ComposeFirstClassChoosebtn");
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | if (curThirdType == cell.index)
|
| | | {
|
| | | icon.SetSprite("ChildListBtn_Select");
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType,cell.index);
|
| | | RefreshUI(compoundModel);
|
| | | }
|
| | | else
|
| | |
| | | private void OnClickSecondType(int secondType)
|
| | | {
|
| | | curSecondType = secondType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.MountDogz, curSecondType);
|
| | |
|
| | | foreach (var thirdType in secondTypeDict.Keys)
|
| | | {
|
| | |
| | | for (i = 0; i < previewItemlist.Count; i++)
|
| | | {
|
| | | GameObject gridCell = previewItemlist[i].transform.Find("GridCell").gameObject;
|
| | | if (i < composeWinModel.makeIDs.Length)
|
| | | int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
|
| | | if(makeIds != null)
|
| | | {
|
| | | RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | | RefreshGridCellUI(gridCell, false, makeIds[i], NeedMatType.MakeItem);
|
| | | }
|
| | | else
|
| | | {
|
| | | RefreshGridCellUI(gridCell,true);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | posBtn.RemoveAllListeners();
|
| | | }
|
| | | fixedItemIndexDict.Clear();
|
| | | for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | 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 < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | 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,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
|
| | | RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
|
| | |
|
| | | List<int> itemIndexlist = null;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
|
| | | }
|
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < unfixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemDisplay[i] != 0)
|
| | | if (unfixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
|
| | | 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>();
|
| | |
| | |
|
| | | 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 < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for(i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | if(composeWinModel.costfixedItemIDs[i] == itemId)
|
| | | if(fixedIds[i] == itemId)
|
| | | {
|
| | | if (haveCount >= composeWinModel.costfixedItemCounts[i])
|
| | | if (haveCount >= fixedCounts[i])
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
|
| | | "/",composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/", fixedCounts[i].ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
|
| | | "/", composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/", fixedCounts[i].ToString());
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
|
| | | UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
|
| | | successRate = 0;
|
| | | composeWinModel.funcType = ComposeFuncType.Equip;
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel();
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Equip);
|
| | | CreateCell();
|
| | | if(curSecondType == 0)
|
| | | {
|
| | |
| | | {
|
| | | arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
|
| | | icon.SetSprite("ComposeFirstClassChoosebtn");
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Equip, curSecondType);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | if (curThirdType == cell.index)
|
| | | {
|
| | | icon.SetSprite("ChildListBtn_Select");
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
|
| | | CreateEquipTypeLineCell();
|
| | | }
|
| | | else
|
| | |
| | | private void OnClickSecondType(int secondType)
|
| | | {
|
| | | curSecondType = secondType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Equip, curSecondType);
|
| | |
|
| | | foreach (var thirdType in secondTypeDict.Keys)
|
| | | {
|
| | |
| | | #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 < composeWinModel.makeIDs.Length)
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | | RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
|
| | | RefreshGridCellUI(gridCell, false, makeIds[i],NeedMatType.MakeItem);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | #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;
|
| | |
| | | posBtn.RemoveAllListeners();
|
| | | }
|
| | | fixedItemIndexDict.Clear();
|
| | | for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | 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,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
|
| | | RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
|
| | |
|
| | | List<int> itemIndexlist = null;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
|
| | | }
|
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < unfixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemDisplay[i] != 0)
|
| | | if (unfixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
|
| | | 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>();
|
| | |
| | |
|
| | | 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 < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for(i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | if(composeWinModel.costfixedItemIDs[i] == itemId)
|
| | | if(fixedIds[i] == itemId)
|
| | | {
|
| | | if (haveCount >= composeWinModel.costfixedItemCounts[i])
|
| | | if (haveCount >= fixedCounts[i])
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
|
| | | "/",composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/",fixedCounts[i].ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
|
| | | "/", composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/", fixedCounts[i].ToString());
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
|
| | | composeWinModel.funcType = ComposeFuncType.Ticket;
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel();
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Ticket);
|
| | | bool isJumpTo = false;
|
| | | if (AchievementGoto.guideAchievementId != 0)
|
| | | {
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket,composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | {
|
| | | isJumpTo = false;
|
| | | bool isCanCompose = true;
|
| | | if (!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
|
| | | isCanCompose = false;
|
| | |
| | | {
|
| | | arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
|
| | | icon.SetSprite("ComposeFirstClassChoosebtn");
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
|
| | | //ClickSecondTypeUICtrl();
|
| | | }
|
| | | else
|
| | |
| | | if (curThirdType == cell.index)
|
| | | {
|
| | | icon.SetSprite("ChildListBtn_Select");
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
|
| | | RefreshUI(compoundModel);
|
| | | }
|
| | | else
|
| | |
| | | private void OnClickSecondType(int secondType)
|
| | | {
|
| | | curSecondType = secondType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Ticket, curSecondType);
|
| | | foreach (var thirdType in secondTypeDict.Keys)
|
| | | {
|
| | | if (thirdType != 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 < composeWinModel.makeIDs.Length)
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | | RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
|
| | | RefreshGridCellUI(gridCell, false,makeIds[i],NeedMatType.MakeItem);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | #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++)
|
| | | {
|
| | |
| | | posBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | fixedItemIndexDict.Clear();
|
| | | for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | 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,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
|
| | | |
| | | List<int> itemIndexlist = null;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if(singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | }
|
| | | |
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | }
|
| | | RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
|
| | | }
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < unfixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemDisplay[i] != 0)
|
| | | if (unfixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
|
| | | 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>();
|
| | |
| | |
|
| | | 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 < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for(i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | if(composeWinModel.costfixedItemIDs[i] == itemId)
|
| | | if(fixedIds[i] == itemId)
|
| | | {
|
| | | if (haveCount >= composeWinModel.costfixedItemCounts[i])
|
| | | if (haveCount >= fixedCounts[i])
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
|
| | | "/",composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/",fixedCounts[i].ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
|
| | | "/", composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/", fixedCounts[i].ToString());
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | |
|
| | | private void ClickAllComposeBtn()
|
| | | {
|
| | | List<int> composeCountlist = new List<int>();
|
| | | fixedItemIndexDict.Clear();
|
| | | if (compoundModel == null) return;
|
| | |
|
| | | List<int> composeCountlist = new List<int>();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if(composeWinModel.costfixedItemIDs != null)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | | for (int i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | {
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, composeWinModel.costfixedItemIDs[i]);
|
| | | int canComposeCount = haveCount / composeWinModel.costfixedItemCounts[i];
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, fixedIds[i]);
|
| | | int canComposeCount = haveCount / fixedCounts[i];
|
| | | composeCountlist.Add(canComposeCount);
|
| | | List<int> itemIndexlist = null;
|
| | | if (singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i] * canComposeCount);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i], fixedCounts[i] * canComposeCount);
|
| | | }
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | |
|
| | | composeCountlist.Sort();
|
| | |
| | | }
|
| | | composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect, composeCnt);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickComposeBtn()
|
| | | {
|
| | | if (compoundModel == null) return;
|
| | |
|
| | | SetFixedItemIndexDic();
|
| | | composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
|
| | | }
|
| | |
|
| | | private void SetFixedItemIndexDic()
|
| | | {
|
| | | fixedItemIndexDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return;
|
| | | if (singlePack == null || compoundModel == null) return;
|
| | |
|
| | | 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);
|
| | |
|
| | | fixedItemIndexDict.Clear();
|
| | |
|
| | | for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for (int i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | List<int> itemIndexlist = null;
|
| | | if (minBindCnt >= composeWinModel.costfixedItemCounts[i])
|
| | | if (minBindCnt >= fixedCounts[i])
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 1);
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 1);
|
| | | }
|
| | | else if(minNoBindCnt >= composeWinModel.costfixedItemCounts[i])
|
| | | else if(minNoBindCnt >= fixedCounts[i])
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i],0);
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i],0);
|
| | | }
|
| | | else
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
|
| | | }
|
| | |
|
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnComposeAnswer;
|
| | | composeWinModel.funcType = ComposeFuncType.Item;
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel();
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Item);
|
| | | bool isJumpTo = false;
|
| | | if (AchievementGoto.guideAchievementId != 0)
|
| | | {
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item,composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = second;
|
| | | curThirdType = int.Parse(thirdType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(second);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, second);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | break;
|
| | |
| | | {
|
| | | isJumpTo = false;
|
| | | bool isCanCompose = true;
|
| | | if (!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | if (!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
|
| | | isCanCompose = false;
|
| | |
| | | {
|
| | | arrowIcon.transform.localRotation = Quaternion.Euler(0, 0, -90);
|
| | | icon.SetSprite("ComposeFirstClassChoosebtn");
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, curSecondType);
|
| | | //ClickSecondTypeUICtrl();
|
| | | }
|
| | | else
|
| | |
| | | if (curThirdType == cell.index)
|
| | | {
|
| | | icon.SetSprite("ChildListBtn_Select");
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType,compoundModel.secondType,cell.index);
|
| | | RefreshUI(compoundModel);
|
| | | }
|
| | | else
|
| | |
| | | private void OnClickSecondType(int secondType)
|
| | | {
|
| | | curSecondType = secondType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Item, curSecondType);
|
| | | foreach (var thirdType in secondTypeDict.Keys)
|
| | | {
|
| | | if (thirdType != 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 < composeWinModel.makeIDs.Length)
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | |
|
| | | RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
|
| | | RefreshGridCellUI(gridCell, false,makeIds[i],NeedMatType.MakeItem);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | #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;
|
| | |
| | | posBtn.RemoveAllListeners();
|
| | | }
|
| | |
|
| | | fixedItemIndexDict.Clear();
|
| | | for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | 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,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
|
| | | List<int> itemIndexlist = null;
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | }
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
|
| | | }
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < unfixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemDisplay[i] != 0)
|
| | | if (unfixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
|
| | | 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>();
|
| | |
| | |
|
| | | 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 < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for(i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | if(composeWinModel.costfixedItemIDs[i] == itemId)
|
| | | if(fixedIds[i] == itemId)
|
| | | {
|
| | | if (haveCount >= composeWinModel.costfixedItemCounts[i])
|
| | | if (haveCount >= fixedCounts[i])
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
|
| | | "/",composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/",fixedCounts[i].ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
|
| | | "/", composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/",fixedCounts[i].ToString());
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | |
|
| | | private void OnClickComposeBtn()
|
| | | {
|
| | | if (compoundModel == null) return;
|
| | |
|
| | | SetFixedItemIndexDic();
|
| | | composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict,composeEffect,1);
|
| | | }
|
| | |
|
| | | private void SetFixedItemIndexDic()
|
| | | {
|
| | | fixedItemIndexDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return;
|
| | | if (singlePack == null || compoundModel == null) return;
|
| | |
|
| | | int minBindCnt = 0;
|
| | | int minNoBindCnt = 0;
|
| | | composeWinModel.GetBindOrNoBindMinCnt(out minBindCnt, out minNoBindCnt);
|
| | |
|
| | | fixedItemIndexDict.Clear();
|
| | |
|
| | | for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | | for (int i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | List<int> itemIndexlist = null;
|
| | | if (minBindCnt >= composeWinModel.costfixedItemCounts[i])
|
| | | if (minBindCnt >= fixedCounts[i])
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 1);
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 1);
|
| | | }
|
| | | else if (minNoBindCnt >= composeWinModel.costfixedItemCounts[i])
|
| | | else if (minNoBindCnt >= fixedCounts[i])
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i], 0);
|
| | | itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i],fixedCounts[i], 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i]);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i]);
|
| | | }
|
| | |
|
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void OnClickComposeAllBtn()
|
| | | {
|
| | | if (compoundModel == null) return;
|
| | |
|
| | | List<int> composeCountlist = new List<int>();
|
| | | fixedItemIndexDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if(composeWinModel.costfixedItemIDs != null)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | |
|
| | | for (int i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | for (int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | {
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, composeWinModel.costfixedItemIDs[i]);
|
| | | int canComposeCount = haveCount / composeWinModel.costfixedItemCounts[i];
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
|
| | | int canComposeCount = haveCount / fixedCounts[i];
|
| | | composeCountlist.Add(canComposeCount);
|
| | | List<int> itemIndexlist = null;
|
| | | if (singlePack != null)
|
| | | {
|
| | | itemIndexlist = singlePack.ItemIndexlist(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i] * canComposeCount);
|
| | | itemIndexlist = singlePack.ItemIndexlist(fixedIds[i],fixedCounts[i] * canComposeCount);
|
| | | }
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | | composeCountlist.Sort();
|
| | | composeWinModel.SendComposeRequest(compoundModel, fixedItemIndexDict, composeEffect,composeCountlist[0]);
|
| | | } |
| | | }
|
| | |
|
| | | private void OnComposeAnswer(HA814_tagMCMakeItemAnswer answer)
|
| | |
| | | {
|
| | | SetComposeTypeRed();
|
| | | RefreshComposeRed();
|
| | | funcType = ComposeFuncType.Wings;
|
| | | playerPack.RefreshItemCountAct -= OnItemCntRefresh;
|
| | | playerPack.RefreshItemCountAct += OnItemCntRefresh;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerLvUpdate;
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | public Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> GetFirstTypeModel()
|
| | |
|
| | | public Dictionary<int, Dictionary<int, List<ItemCompoundConfig>>> GetFirstTypeModel(int firstType)
|
| | | {
|
| | | firstTypeDict = null;
|
| | | firstTypeDict = ItemCompoundConfig.GetFirstComposeTypeDict((int)funcType);
|
| | | firstTypeDict = ItemCompoundConfig.GetFirstComposeTypeDict((int)firstType);
|
| | | return firstTypeDict;
|
| | | }
|
| | |
|
| | | public Dictionary<int, List<ItemCompoundConfig>> GetSecondTypeModel(int secondType)
|
| | | public Dictionary<int, List<ItemCompoundConfig>> GetSecondTypeModel(int firstType,int secondType)
|
| | | {
|
| | | GetFirstTypeModel(firstType);
|
| | | secondTypeDict = null;
|
| | | if (firstTypeDict != null)
|
| | | {
|
| | | firstTypeDict.TryGetValue(secondType, out secondTypeDict);
|
| | | }
|
| | | return secondTypeDict;
|
| | | }
|
| | |
|
| | | public List<ItemCompoundConfig> GetThirdTypeModellist(int thirdType)
|
| | | public List<ItemCompoundConfig> GetThirdTypeModellist(int firstType,int secondType,int thirdType)
|
| | | {
|
| | | List<ItemCompoundConfig> modellist = null;
|
| | | GetSecondTypeModel(firstType, secondType);
|
| | | if(secondTypeDict != null)
|
| | | {
|
| | | secondTypeDict.TryGetValue(thirdType, out modellist);
|
| | | }
|
| | | return modellist;
|
| | | }
|
| | |
|
| | |
| | | return itemId;
|
| | | }
|
| | |
|
| | | public int[] makeIDs { get; private set; }
|
| | | public int[] unfixedItemIDs { get; private set; }
|
| | | public int[] costfixedItemIDs { get; private set; }
|
| | | public int[] costfixedItemCounts { get; private set; }
|
| | | public int[] unfixedItemDisplay { get; private set; }
|
| | | public int[] fixedItemDisplay { get; private set; }
|
| | |
|
| | | public ItemCompoundConfig CurComposeModel { get; private set; }
|
| | |
|
| | | public void SetCurComposeModel(ItemCompoundConfig compoundModel)
|
| | | {
|
| | | CurComposeModel = compoundModel;
|
| | | makeIDs = ConfigParse.GetMultipleStr<int>(compoundModel.makeID);
|
| | | unfixedItemIDs = ConfigParse.GetMultipleStr<int>(compoundModel.unfixedItemID);
|
| | | costfixedItemIDs = ConfigParse.GetMultipleStr<int>(compoundModel.itemID);
|
| | | costfixedItemCounts = ConfigParse.GetMultipleStr<int>(compoundModel.itemCount);
|
| | | unfixedItemDisplay = ConfigParse.GetMultipleStr<int>(compoundModel.unfixedItemDisplay);
|
| | | fixedItemDisplay = ConfigParse.GetMultipleStr<int>(compoundModel.itemDisplay);
|
| | | }
|
| | |
|
| | | public bool IsEnoughUnfixedMat(ItemCompoundConfig compoundModel)
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | public bool IsEnoughFixedMat()
|
| | | public bool IsEnoughFixedMat(ItemCompoundConfig config)
|
| | | {
|
| | | for ( int i = 0; i < costfixedItemCounts.Length; i++)
|
| | | if (config == null) return false;
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(config.id,DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(config.id, DisplayItemArray.FixedCounts);
|
| | | for ( int i = 0; i < fixedCounts.Length; i++)
|
| | | {
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, costfixedItemIDs[i]);
|
| | | if (haveCount < costfixedItemCounts[i])
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
|
| | | if (haveCount < fixedCounts[i])
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | for (i = 0; i < costfixedItemCounts.Length; i++)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | | for (i = 0; i < fixedCounts.Length; i++)
|
| | | {
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem, costfixedItemIDs[i]);
|
| | | if (haveCount < costfixedItemCounts[i])
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,fixedIds[i]);
|
| | | if (haveCount < fixedCounts[i])
|
| | | {
|
| | | ItemConfig fixedConfig = Config.Instance.Get<ItemConfig>(costfixedItemIDs[i]);
|
| | | ItemConfig fixedConfig = Config.Instance.Get<ItemConfig>(fixedIds[i]);
|
| | | if (fixedConfig.GetWay.Length < 1)
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(fixedConfig.ID);
|
| | |
| | | noBindCnt = fixedMatIsBindDict[idlist[0]][0];
|
| | | }
|
| | |
|
| | | int remainBind = bindCnt % costfixedItemCounts[0];
|
| | | int remainNOBind = noBindCnt % costfixedItemCounts[0];
|
| | | bindCnt = bindCnt / costfixedItemCounts[0];
|
| | | noBindCnt = noBindCnt / costfixedItemCounts[0];
|
| | | int remainBind = bindCnt % fixedCounts[0];
|
| | | int remainNOBind = noBindCnt % fixedCounts[0];
|
| | | bindCnt = bindCnt / fixedCounts[0];
|
| | | noBindCnt = noBindCnt / fixedCounts[0];
|
| | | if (bindCnt + noBindCnt < composeCount)
|
| | | {
|
| | | bindCnt = composeCount - noBindCnt;
|
| | |
| | |
|
| | | private string GetComposeInfoStr(int bindCnt,int noBindCnt)
|
| | | {
|
| | | ItemConfig config = Config.Instance.Get<ItemConfig>(makeIDs[0]);
|
| | | if (CurComposeModel == null) return string.Empty;
|
| | | int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(CurComposeModel.id,DisplayItemArray.MakeIds);
|
| | | ItemConfig config = Config.Instance.Get<ItemConfig>(makeIds[0]);
|
| | | StringBuilder stringBuilder = new StringBuilder();
|
| | | if (bindCnt > 0)
|
| | | {
|
| | |
| | | {
|
| | | minBindCnt = 0;
|
| | | minNoBindCnt = 0;
|
| | | if (costfixedItemIDs == null) return;
|
| | | if (CurComposeModel == null) return;
|
| | |
|
| | | Dictionary<int, int> bindCntDic = new Dictionary<int, int>();
|
| | | Dictionary<int, int> noBindCntDic = new Dictionary<int, int>();
|
| | |
|
| | | for (int i = 0; i < costfixedItemIDs.Length;i++)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(CurComposeModel.id,DisplayItemArray.FixedIds);
|
| | | for (int i = 0; i < fixedIds.Length;i++)
|
| | | {
|
| | | List<ItemModel> list = null;
|
| | | playerPack.GetSinglePackModel(PackType.rptItem).GetItemCountByID(costfixedItemIDs[i],out list);
|
| | | playerPack.GetSinglePackModel(PackType.rptItem).GetItemCountByID(fixedIds[i],out list);
|
| | | if(list != null)
|
| | | {
|
| | | int bindCnt = 0;
|
| | |
| | | noBindCnt += list[j].itemInfo.ItemCount;
|
| | | }
|
| | | }
|
| | | bindCntDic.Add(costfixedItemIDs[i], bindCnt);
|
| | | noBindCntDic.Add(costfixedItemIDs[i], noBindCnt);
|
| | | bindCntDic.Add(fixedIds[i], bindCnt);
|
| | | noBindCntDic.Add(fixedIds[i], noBindCnt);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | this.secondType = secondType;
|
| | | this.thirdType = thirdType;
|
| | | funcType = type;
|
| | | GetFirstTypeModel();
|
| | | Dictionary<int, List<ItemCompoundConfig>> dict = GetSecondTypeModel(secondType);
|
| | | GetFirstTypeModel((int)type);
|
| | | Dictionary<int, List<ItemCompoundConfig>> dict = GetSecondTypeModel((int)type,secondType);
|
| | | if(dict == null)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FuncLimit_Level");
|
| | |
| | | List<ItemCompoundConfig> compoundlist = firstDict[3][thirdType];
|
| | | for(int i = 0; i < compoundlist.Count; i++)
|
| | | {
|
| | | SetCurComposeModel(compoundlist[i]);
|
| | | int makeID = ConfigParse.GetMultipleStr<int>(compoundlist[i].makeID)[i];
|
| | | string key = StringUtility.Contact(3, 10, thirdType);
|
| | | if (IsComposeJobLimit(makeID) && IsEnoughFixedMat())
|
| | | if (IsComposeJobLimit(makeID) && IsEnoughFixedMat(compoundlist[i]))
|
| | | {
|
| | | if (thirdTypeRedDict[key].state != RedPointState.Simple)
|
| | | {
|
| | |
| | | addItem,
|
| | | }
|
| | |
|
| | | public enum DisplayItemArray
|
| | | {
|
| | | MakeIds,
|
| | | UnfixedIds,
|
| | | FixedIds,
|
| | | FixedCounts,
|
| | | UnfixedDisplay,
|
| | | FixedDisplay,
|
| | | }
|
| | |
|
| | |
| | | UIEventTrigger.Get(helpBtn.gameObject).OnDown = OnClickHelpBtn;
|
| | | UIEventTrigger.Get(helpBtn.gameObject).OnUp = OnDownUp;
|
| | |
|
| | | composeWinModel.funcType = ComposeFuncType.Wings;
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel();
|
| | | firstTypeDict = composeWinModel.GetFirstTypeModel((int)ComposeFuncType.Wings);
|
| | | bool isJumpTo = false;
|
| | | SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
|
| | | if (successConfig != null && successConfig.Type == 69)
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings,composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | isJumpTo = true;
|
| | | curSecondType = composeWinModel.secondType;
|
| | | curThirdType = composeWinModel.thirdType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(composeWinModel.secondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, composeWinModel.secondType);
|
| | | ClickSecondTypeUICtrl();
|
| | | composeWinModel.ResetJumpToModel();
|
| | | }
|
| | |
| | | {
|
| | | isJumpTo = false;
|
| | | bool isCanCompose = true;
|
| | | if(!composeWinModel.IsEnoughFixedMat() || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | if(!composeWinModel.IsEnoughFixedMat(compoundModel) || !composeWinModel.IsEnoughUnfixedMat(compoundModel))
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("Compose101"));
|
| | | isCanCompose = false;
|
| | |
| | | {
|
| | | icon.SetSprite("ComposeFirstClassChoosebtn");
|
| | | arrowIcon.transform.localRotation = Quaternion.Euler(0,0,-90);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
|
| | | //ClickSecondTypeUICtrl();
|
| | | }
|
| | | else
|
| | |
| | | if (curThirdType == cell.index)
|
| | | {
|
| | | icon.SetSprite("ChildListBtn_Select");
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(cell.index);
|
| | | thirdTypelist = composeWinModel.GetThirdTypeModellist(compoundModel.firstType, compoundModel.secondType, cell.index);
|
| | | RefreshUI(compoundModel);
|
| | | }
|
| | | else
|
| | |
| | | private void OnClickSecondType(int secondType)
|
| | | {
|
| | | curSecondType = secondType;
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel(curSecondType);
|
| | | secondTypeDict = composeWinModel.GetSecondTypeModel((int)ComposeFuncType.Wings, curSecondType);
|
| | | foreach(var thirdType in secondTypeDict.Keys)
|
| | | {
|
| | | if(thirdType != 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 < composeWinModel.makeIDs.Length)
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | | RefreshGridCellUI(gridCell, false, composeWinModel.makeIDs[i],NeedMatType.MakeItem);
|
| | | RefreshGridCellUI(gridCell, false, makeIds[i],NeedMatType.MakeItem);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | #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;
|
| | |
| | | RefreshGridCellUI(gridCell,true);
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | 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,composeWinModel.costfixedItemIDs[i],NeedMatType.fixedItem);
|
| | | RefreshGridCellUI(gridCell,false,fixedIds[i],NeedMatType.fixedItem);
|
| | | }
|
| | | }
|
| | |
|
| | | for (i = 0; i < composeWinModel.unfixedItemDisplay.Length; i++)
|
| | | for (i = 0; i < unfixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemDisplay[i] != 0)
|
| | | if (unfixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.unfixedItemDisplay[i] - 1];
|
| | | 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>();
|
| | |
| | |
|
| | | 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 < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | for(i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | if(composeWinModel.costfixedItemIDs[i] == itemId)
|
| | | if(fixedIds[i] == itemId)
|
| | | {
|
| | | if (haveCount >= composeWinModel.costfixedItemCounts[i])
|
| | | if (haveCount >= fixedCounts[i])
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Green,haveCount.ToString()),
|
| | | "/",composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/",fixedCounts[i].ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, haveCount.ToString()),
|
| | | "/", composeWinModel.costfixedItemCounts[i].ToString());
|
| | | "/", fixedCounts[i].ToString());
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | private bool ChangeFixedMatUI()
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return false;
|
| | | if (singlePack == null || compoundModel == null) return false;
|
| | |
|
| | | bool isBind = false;
|
| | | Dictionary<int,ItemModel> unfixedMatDict = selectModel.GetHaveUnfixedSelectItem();
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < composeWinModel.fixedItemDisplay.Length; i++)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | | int[] fixedDisplay = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedDisplay);
|
| | | for (int i = 0; i < fixedDisplay.Length; i++)
|
| | | {
|
| | | if (composeWinModel.fixedItemDisplay[i] != 0)
|
| | | if (fixedDisplay[i] != 0)
|
| | | {
|
| | | GameObject matPos = sourceItemlist[composeWinModel.fixedItemDisplay[i] - 1];
|
| | | GameObject matPos = sourceItemlist[fixedDisplay[i] - 1];
|
| | | ItemCell itemCell = matPos.transform.Find("GridCell/ItemCell").GetComponent<ItemCell>();
|
| | | int fixedId = composeWinModel.costfixedItemIDs[i];
|
| | | int fixedId = fixedIds[i];
|
| | | itemCell.bindIcon.gameObject.SetActive(false);
|
| | | if (isBind)
|
| | | {
|
| | |
| | | {
|
| | | fixedItemIndexDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return;
|
| | | if (singlePack == null || compoundModel == null) return;
|
| | | int isBind = 0;
|
| | |
|
| | | if(IsComposeBind)
|
| | |
| | | {
|
| | | isBind = 0;
|
| | | }
|
| | |
|
| | | for(int i = 0; i < composeWinModel.costfixedItemIDs.Length; i++)
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedIds);
|
| | | int[] fixedCounts = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id, DisplayItemArray.FixedCounts);
|
| | | for (int i = 0; i < fixedIds.Length; i++)
|
| | | {
|
| | | List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(composeWinModel.costfixedItemIDs[i], composeWinModel.costfixedItemCounts[i],isBind);
|
| | | List<int> itemIndexlist = singlePack.ItemIndexlistByIsBind(fixedIds[i], fixedCounts[i],isBind);
|
| | | if (itemIndexlist != null)
|
| | | {
|
| | | fixedItemIndexDict.Add(composeWinModel.costfixedItemIDs[i], itemIndexlist);
|
| | | fixedItemIndexDict.Add(fixedIds[i], itemIndexlist);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | private UIEffect GetPlayMatEffect()
|
| | | {
|
| | | int matTypeCnt = compoundModel.unfixedItemCount + composeWinModel.costfixedItemIDs.Length;
|
| | | if(compoundModel == null) return null;
|
| | |
|
| | | int[] fixedIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.FixedIds);
|
| | | int matTypeCnt = compoundModel.unfixedItemCount + fixedIds.Length;
|
| | | switch (matTypeCnt)
|
| | | {
|
| | | case 1:
|
| | |
| | | if (answer.Result == 1)
|
| | | {
|
| | | successEffect.Play();
|
| | | int[] makeIds = ItemCompoundConfig.GetDisplayArrayByType(compoundModel.id,DisplayItemArray.MakeIds);
|
| | | for (int i = 0; i < previewItemlist.Count; i++)
|
| | | {
|
| | | UIEffect targetEffect = previewItemlist[i].transform.Find("GridCell/TargetEffect").GetComponent<UIEffect>();
|
| | | if (i < composeWinModel.makeIDs.Length)
|
| | | if (i < makeIds.Length)
|
| | | {
|
| | | if(composeWinModel.makeIDs[i] == answer.MakeItemID)
|
| | | if(makeIds[i] == answer.MakeItemID)
|
| | | {
|
| | | targetEffect.Play();
|
| | | break;
|
| | |
| | | public Dictionary<int, ItemModel> GetUnfixedItemModel()
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null)
|
| | | if (singlePack == null || composeWinModel.CurComposeModel == null)
|
| | | return null;
|
| | |
|
| | | int[] unfixedIds = ItemCompoundConfig.GetDisplayArrayByType(composeWinModel.CurComposeModel.id,DisplayItemArray.UnfixedIds);
|
| | | allBagItemInfo = singlePack.GetPackModelIndexDict();
|
| | | _unfixedItemDict.Clear();
|
| | | foreach (int key in allBagItemInfo.Keys)
|
| | |
| | | if (!haveUnfixedSelectItemDic.ContainsKey(key))
|
| | | {
|
| | | int i = 0;
|
| | | for (i = 0; i < composeWinModel.unfixedItemIDs.Length; i++)
|
| | | for (i = 0; i < unfixedIds.Length; i++)
|
| | | {
|
| | | if (composeWinModel.unfixedItemIDs[i] == allBagItemInfo[key].itemInfo.ItemID)
|
| | | if (unfixedIds[i] == allBagItemInfo[key].itemInfo.ItemID)
|
| | | {
|
| | | _unfixedItemDict.Add(key, allBagItemInfo[key]);
|
| | | break;
|
| | |
| | |
|
| | | public class LaunchWin : Window
|
| | | {
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | | [SerializeField] Image m_BackGround;
|
| | | [SerializeField] SmoothSlider m_ProgressSlider;
|
| | | [SerializeField] Text m_Progress;
|
| | | [SerializeField] Text m_BuildTime;
|
| | |
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | var sprite = Resources.Load<Sprite>("UI/Sprites/Launch");
|
| | | m_BackGround.overrideSprite = sprite;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | behaviourProgress = 0f;
|
| | | trueProgress = 0f;
|
| | | m_ProgressSlider.ResetValue(0f);
|
| | | m_AlphaTween.SetStartState();
|
| | |
|
| | | m_Version.text = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
|
| | | if (VersionConfig.Get().debugVersion)
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | public void FadeOut()
|
| | | {
|
| | | m_AlphaTween.Play();
|
| | | }
|
| | |
|
| | | void UpdateLoadingProgress(Launch.LaunchStage _stage, float _progress)
|
| | | {
|
| | | trueProgress = Mathf.Max(_progress, behaviourProgress);
|
| | |
| | | if (weaponId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(weaponId);
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | pool.Release(weaponModel);
|
| | | }
|
| | | weaponModel = null;
|
| | | }
|
| | |
|
| | | if (secondaryId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryId);
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | pool.Release(secondaryModel);
|
| | | secondaryModel.SetActive(true);
|
| | | }
|
| | | secondaryModel = null;
|
| | | }
|
| | |
|
| | | if (wingsId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(wingsId);
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | pool.Release(wingsModel);
|
| | | }
|
| | | wingsModel = null;
|
| | | wingsAnimator = null;
|
| | | }
|
| | |
| | | if (clothesId != 0)
|
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(clothesId);
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | pool.Release(clothesModel);
|
| | | }
|
| | | clothesModel = null;
|
| | | if (clothesAnimator)
|
| | | {
|
| | |
| | | if (clothesModel != null)
|
| | | {
|
| | | var animator = clothesModel.GetComponent<Animator>();
|
| | | if (animator)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_IdleHash);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (clothesModel != null)
|
| | | {
|
| | | var animator = clothesModel.GetComponent<Animator>();
|
| | | if (animator)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_SitDown);
|
| | | }
|
| | | }
|
| | |
|
| | | if (weaponModel)
|
| | | {
|
| | | GameObject prefab = InstanceResourcesLoader.LoadModelRes(weaponId);
|
| | | if (prefab)
|
| | | {
|
| | | GameObjectPoolManager.Instance.ReleaseGameObject(prefab, weaponModel);
|
| | | }
|
| | | weaponModel = null;
|
| | | }
|
| | |
|
| | |
| | | LoadClothes(newClothes);
|
| | | clothesId = newClothes;
|
| | |
|
| | | if (clothesModel)
|
| | | {
|
| | | if (weaponModel)
|
| | | {
|
| | | var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.WeaponBindBoneName);
|
| | |
| | |
|
| | | LoadClothesEffect(itemID, suitID);
|
| | | }
|
| | | }
|
| | |
|
| | | private void LoadClothes(int resID)
|
| | | {
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(resID);
|
| | | if (prefab)
|
| | | {
|
| | | var pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | clothesModel = pool.Request();
|
| | |
|
| | |
| | | clothesModel.transform.SetParentEx(showPoint, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | clothesAnimator = clothesModel.GetComponent<Animator>();
|
| | |
|
| | | if (clothesAnimator == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("角色资源: {0} 没有动画控制器", resID);
|
| | | }
|
| | |
|
| | | // 动画状态机修改
|
| | | if (clothesAnimator)
|
| | | {
|
| | |
| | | RuntimeAnimatorController _controller = AnimatorControllerLoader.Load(AnimatorControllerLoader.controllerUISuffix, resID);
|
| | | clothesAnimator.runtimeAnimatorController = _controller;
|
| | | clothesAnimator.enabled = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.LogErrorFormat("角色资源: {0} 没有动画控制器", resID);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWeapon);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | weaponModel = pool.Request();
|
| | |
|
| | | LayerUtility.SetLayer(weaponModel, LayerUtility.Player, false);
|
| | | var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.WeaponBindBoneName);
|
| | | weaponModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | |
|
| | | weaponId = newWeapon;
|
| | | }
|
| | |
|
| | |
| | | newSecondary = config.BaseEquip[2];
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(newSecondary);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | secondaryModel = pool.Request();
|
| | |
|
| | | var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.SecondaryBindBoneName[job - 1]);
|
| | | secondaryModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | }
|
| | | }
|
| | |
|
| | | secondaryId = newSecondary;
|
| | |
| | | prefab = InstanceResourcesLoader.LoadModelRes(newWings);
|
| | | }
|
| | |
|
| | | if (prefab)
|
| | | {
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | wingsModel = pool.Request();
|
| | |
|
| | |
| | | wingsAnimator.enabled = true;
|
| | | wingsAnimator.Play("UI_Idle", 0);
|
| | | }
|
| | | }
|
| | |
|
| | | wingsId = newWings;
|
| | | }
|