Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
    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>();
 }
Beispiel #4
0
 public void SetUIItem(CUIItem tUITem)
 {
     UIItem = tUITem;
 }