void OnGrowthfundUpdate(int val) { for (int i = 0; i < items.Count; i++) { GrowthfundCell onlinecell = items[i].GetComponent <GrowthfundCell>(); for (int j = 0; j < GamePlayer.Instance.fundtags_.Count; j++) { if (onlinecell.GrowthReawData._Iv == GamePlayer.Instance.fundtags_[j]) { onlinecell.enterBtn.gameObject.SetActive(false); onlinecell.sp.gameObject.SetActive(true); } // else // { // onlinecell.enterBtn.gameObject.SetActive(true); // onlinecell.sp.gameObject.SetActive(false); // } } } GrowthfundCell onlinecellone = items[0].GetComponent <GrowthfundCell>(); if (val < onlinecellone.GrowthReawData._Iv) { UpdateGrowthfundState(); } }
void addItem() { foreach (GrowthFundData td in GrowthFundData.GetData().Values) { GameObject go = GameObject.Instantiate(item) as GameObject; go.SetActive(true); go.transform.parent = grid.transform; go.transform.localScale = Vector3.one; GrowthfundCell onlinecell = go.GetComponent <GrowthfundCell>(); onlinecell.GrowthReawData = td; items.Add(go); } grid.Reposition(); }
void UpdateGrowthfundState() { for (int i = 0; i < items.Count; i++) { GrowthfundCell onlinecell = items[i].GetComponent <GrowthfundCell>(); if (onlinecell.GrowthReawData._Iv <= GamePlayer.Instance.GetIprop(PropertyType.PT_Level) && GamePlayer.Instance.isFund_) { onlinecell.enterBtn.isEnabled = true; } else { onlinecell.enterBtn.isEnabled = false; } } }