private void Awake() { for (int i = 0; i < numberOfSlots; ++i) { GameObject slotInstance = Instantiate(_slotPrefab); slotInstance.transform.SetParent(transform); slotInstance.name = "Slot " + i; CUIItem uiItem = slotInstance.GetComponentInChildren <CUIItem>(); uiItem.UpdateItem(null); uiItems.Add(uiItem); } }
private void Start() { if (_selectedItem == null) { _selectedItem = GameObject.Find("SelectedItem").GetComponent <CUIItem>(); _selectedItem.UpdateItem(null); } if (_craftingSlot == null) { _craftingSlot = FindObjectOfType <CCraftingSlots>(); } _tooltip = FindObjectOfType <CTooltip>(); }
private void Awake() { _uiItem = GetComponent <CUIItem>(); }
public void SetUIItem(CUIItem tUITem) { UIItem = tUITem; }