public void ClickCombineItme(ItemeEquipOutSide3cr item) { if (_chooseCombineItem != null) { _chooseCombineItem.UnSelect(); _chooseCombineItem = item; _chooseCombineItem.Select(); ShowChooseItemInfo(_chooseCombineItem.Data as ConfigEquip); } }
ItemeEquipOutSide3cr CreateSynthesisItem(ConfigEquip equip, float x, float y, bool isRoot = false) { GameObject renderPrefab = ResourceManager.Instance.LoadExistsAsset <GameObject>("Prefab/UI/EquipsOutside/ItemeEquipOutSide3cr"); GameObject item = UGUITools.AddChild(go_EquipSynthesiscr, renderPrefab); synthesisItemList.Add(item); ItemeEquipOutSide3cr itemScript = item.AddMissingComponent <ItemeEquipOutSide3cr>(); itemScript.type = 1; itemScript.SetData(equip); if (isRoot) { itemScript.Select(); } item.GetComponent <RectTransform>().anchoredPosition = new Vector2(x, y); return(itemScript); }
private void DrawSynthesis(ConfigEquip equipConfig) { for (int i = 0; i < synthesisItemList.Count; i++) { Destroy(synthesisItemList[i]); } synthesisItemList.Clear(); float rootX = 410f; float rooty = 320f; int secondW = 240; int threew = 120; int height = 100; ItemeEquipOutSide3cr itemScript = CreateSynthesisItem(equipConfig, rootX, rooty, true); _chooseCombineItem = itemScript; int[] combine = equipConfig.combine; if (combine.Length > 0) { if (combine.Length == 1) { itemScript.SetLineInfo(3, 0, 0); } else { itemScript.SetLineInfo(2, secondW * (combine.Length - 1), 0); } bool fx = combine.Length % 2 == 0; for (int i = 0; i < combine.Length; i++) { int equipid = combine[i]; equipConfig = ConfigManager.Instance.GetConfig <ConfigEquip>(equipid); float x = rootX + i * secondW; x = x - ((secondW / 2) * combine.Length) / 2f; if (fx == false) { x += (secondW / 4); } float y = rooty - height; itemScript = CreateSynthesisItem(equipConfig, x, y); int[] three = equipConfig.combine; if (three.Length > 0) { if (three.Length == 1) { itemScript.SetLineInfo(3, 0, 0); } else { itemScript.SetLineInfo(2, threew * (three.Length - 1), 0); } itemScript.SetTopLine(); bool fx1 = three.Length % 2 == 0; for (int j = 0; j < three.Length; j++) { equipid = three[j]; equipConfig = ConfigManager.Instance.GetConfig <ConfigEquip>(equipid); float threex = x + (j * threew); threex = threex - ((threew / 2) * three.Length) / 2f; if (fx1 == false) { threex += (threew / 4); } y = y - height; itemScript = CreateSynthesisItem(equipConfig, threex, y); itemScript.SetLineInfo(1, 0, 0); } } else { itemScript.SetLineInfo(1, 0, 0); } } } }