/// <summary> /// 初始化英雄克隆Item /// </summary> void UpdateHeroItem(int index, RectTransform cell) { if (index < m_HeroCloneList.Count) { UI_HeroCloneItem item = cell.gameObject.GetComponent <UI_HeroCloneItem>(); if (item == null) { item = cell.gameObject.AddComponent <UI_HeroCloneItem>(); } item.index = index; item.InitHeroCloneItemData(m_HeroCloneList[index]); } }
/// <summary> /// 刷新消耗显示 /// </summary> public void UpdateHeroCloneDataUI(GameEvent e) { m_MakAnim.gameObject.SetActive(true); m_MakAnim.SetBool("isMak", true); m_HeroCloneAnim.CrossFade("Boom1", 0.3f); List <RectTransform> cellList = m_HeroLayout.cellList; for (int i = 0; i < cellList.Count; ++i) { UI_HeroCloneItem item = cellList[i].GetComponent <UI_HeroCloneItem>(); if (item.GetHeroId() == (int)e.data) { item.UpdateCosData(); } } StartCoroutine(OnWaitAnimEnd(m_HeroCloneAnim, e)); }