public virtual UIItem AddItem(string duplicateItemName, string itemName, Transform parentTransform) { UIItem item = GetItem(duplicateItemName); UIItem newItem = item.Clone(); newItem.SetName(itemName); newItem.SetParent(this); newItem.transform.SetParent(parentTransform); return(AddItem(newItem)); }
public override void OnCullStateChanged(UIItem item, bool culled) { base.OnCullStateChanged(item, culled); // Load item on demand if (!culled) { LoadItem(item); } }
public virtual UIItem AddItem(UIItem item, Transform parentTransform = null) { mItems.Add(item); if (parentTransform != null) { item.transform.SetParent(parentTransform); item.SetParent(this); } return(item); }
protected virtual void Init(Transform gameObjectTransform) { mItems = new List <UIItem> (); foreach (Transform child in gameObjectTransform) { UIItem item = child.GetComponent <UIItem> (); mItems.Add(item); item.SetParent(this); } SetVisibility(_Visible); SetDisabled(_Disable); }
protected virtual void Init(Transform gameObjectTransform) { mItems = new List <UIItem> (); foreach (Transform child in gameObjectTransform) { UIItem item = child.GetComponent <UIItem> (); mItems.Add(item); item.SetParent(this); } if (!_Visible) { SetVisibility(false); } if (!_Interactive) { SetInteractive(false); } mInteractive = _Interactive; mVisible = _Visible; }
public void SetItem(UIItem item, int index) { mItems.RemoveAt(index); mItems.Insert(index, item); }
public void RemoveItemAt(int index) { UIItem item = GetItemAt(index); RemoveItem(item); }
public void RemoveItem(UIItem item) { mItems.Remove(item); GameObject.Destroy(item.gameObject); }
public void RemoveItem(string itemName) { UIItem item = GetItem(itemName); RemoveItem(item); }
public virtual void UnloadItem(UIItem item) { // Do something here }