void Start() { if (instance != null) { Destroy(this); } else { instance = this; } placablesLayout = placables.GetComponent <LayoutElement> (); utilityLayout = utility.GetComponent <LayoutElement> (); placablesRect = placables.GetComponent <RectTransform> (); utilityRect = utility.GetComponent <RectTransform> (); if (utilityRect.sizeDelta.x > placablesRect.sizeDelta.x) { minWidth = placablesRect.sizeDelta.x; maxWidth = utilityRect.sizeDelta.x; minHeightPref = placablesLayout.preferredHeight; maxHeightPref = utilityLayout.preferredHeight; } else { minWidth = utilityRect.sizeDelta.x; maxWidth = placablesRect.sizeDelta.x; minHeightPref = utilityLayout.preferredHeight; maxHeightPref = placablesLayout.preferredHeight; } UpdateGraphics(); }
void OnTriggerEnter(Collider other) { Player p = other.GetComponent <Player> (); if (p != null) { ActiveItemHotbarHandler.AddItem(item); //p.inventory.AddItem (item, itemQuantity); Destroy(gameObject); } }
public void ChangeHotbar() { ActiveItemHotbarHandler.SwitchActiveHotbar(); }
public void HotbarNavigationRight() { ActiveItemHotbarHandler.MoveSelector(true); }
public void HotbarNavigationLeft() { ActiveItemHotbarHandler.MoveSelector(false); }
public void CheckItemUsage() { ActiveItemHotbarHandler.UseItem(); }