private void AddEventPickUpItem() { if (navigator == null) { navigator = UI_NavigatorManager.Instance.Add(item.ItemName, InputEvent.ACTION_PICK_UP_ITEM); InputEvent.Instance.Event_PickUpItem.AddListener(PickUpItem, GetInstanceID()); } }
public void Add(ref UI_Navigator nav, string text, string letter) { if (navigatorPool.Count == 0) { navigatorPool.Push(Instantiate(prefab, poolTransform)); } nav = navigatorPool.Pop(); nav.SetValue(text, letter); nav.transform.SetParent(transform); Reposition(); }
public void Remove(ref UI_Navigator navigator) { if (navigator == null) { return; } navigator.transform.SetParent(poolTransform); navigatorPool.Push(navigator); Reposition(); navigator = null; }