/// <summary> /// /// </summary> /// <param name="_itemUI"></param> void OnSelectSkillUI(MarketItemUI _itemUI) { //selectSkillUI = _itemUI; //if (OnSelectItemEvent != null) // { // OnSelectItemEvent(selectSkillUI); //} }
/// <summary> /// 刷新表现 /// </summary> public void RefreshItems() { Object marketItemprefab = null; if (marketItemprefab == null) { if (isMyMarketItem) { marketItemprefab = exResources.GetResource(ResourceType.GUI, "Market/MyMarketItem"); } else { marketItemprefab = exResources.GetResource(ResourceType.GUI, "Market/MarketItem"); } } if (marketItemprefab == null) { GameSys.LogError("找不到预制:Market/MarketItem或者Market/MyMarketItem"); return; } Vector3 V3 = Vector3.zero; for (int i = 0; i < marketItemList.Count; i++) { if (!MarketItemContainers.ContainsKey(i)) { GameObject obj = Instantiate(marketItemprefab) as GameObject; Transform parentTransf = this.gameObject.transform; obj.transform.parent = parentTransf; obj.transform.localPosition = V3; obj.transform.localScale = Vector3.one; V3 = new Vector3(V3.x, V3.y - 125, V3.z); MarketItemUI marketItemUI = obj.GetComponent <MarketItemUI>(); marketItemUI.FillInfo(marketItemList[i]); //marketTypeUI.OnSelectEvent += OnSelectSkillUI; MarketItemContainers[i] = marketItemUI; // if (firstRun && skillList[i].SkillLv>0) // { // firstRun = false; // selectSkillUI = skillUI; // UIToggle tog = obj.GetComponent<UIToggle>(); // tog.value = true; // if (OnSelectItemEvent != null) // { // OnSelectItemEvent(selectSkillUI); // } // } } } marketItemprefab = null; }