private void AddIntorductUI(int iSelectIndex) { if (iSelectIndex < 0 || iSelectIndex >= m_listAllTypeInfo.Count) { return; } ItemTypeInfo info = m_listAllTypeInfo[iSelectIndex]; GameObject go = NDLoad.LoadWndItem("BeiBaoItemIntorduct", MyHead.ItemParent.transform); if (go != null) { BeiBaoItemIntorduct item = go.GetComponent <BeiBaoItemIntorduct>(); if (item != null) { item.SetData(info, this); } } }
private void RefreshIntorduct(ItemTypeInfo info) { if (info == null) { return; } BeiBaoItemIntorduct item = gameObject.GetComponentInChildren <BeiBaoItemIntorduct>(); if (item != null) { item.SetData(info, this); item.RefreshUI(); } else { int index = m_listAllTypeInfo.IndexOf(info); if (index >= 0 && index < m_listAllTypeInfo.Count) { AddIntorductUI(index); } } }