//initializing variables, modify at your own risk void Awake() { itemsList = GetComponent <UI_ItemsList>(); if (autoAddSlots == true) { slotGOs.Clear(); allSlots.Clear(); allSlotsStack.Clear(); allDur.Clear(); for (int i = 0; i < slotGOHolder.transform.childCount; i++) { slotGOs.Add(slotGOHolder.transform.GetChild(i).gameObject); allSlots.Add(null); allSlotsStack.Add(0); allDur.Add(0); } } if (autoAdjustSlotsID == true) { for (int i = 0; i < slotGOHolder.transform.childCount; i++) { slotGOHolder.transform.GetChild(i).GetComponent <UI_Slot>().slotID = i; slotGOHolder.transform.GetChild(i).GetComponent <UI_Slot>().contextMenu = contextMenu; } } }
void Awake() { inv = inventoryGO.GetComponent <UI_Inventory>(); itemList = inventoryGO.GetComponent <UI_ItemsList>(); eventManager = inventoryGO.GetComponent <UI_EventManager>(); hotbar = inventoryGO.GetComponent <UI_Hotbar>(); if (playerEquipGO == null) { playerEquipGO = GameObject.Find("PlayerEquipment"); } playerEquipment = playerEquipGO.GetComponent <UI_PlayerEquipment>(); }
void Awake() { inventoryGO = GameObject.Find("Ultimate Inventory Pro"); inv = inventoryGO.GetComponent <UI_Inventory>(); itemList = inventoryGO.GetComponent <UI_ItemsList>(); eventManager = inventoryGO.GetComponent <UI_EventManager>(); hotbar = inventoryGO.GetComponent <UI_Hotbar>(); if (playerEquipGO == null) { playerEquipGO = GameObject.Find("PlayerEquipment"); } playerEquipment = playerEquipGO.GetComponent <UI_PlayerEquipment>(); conScript = container.GetComponent <UI_Container>(); }
void Awake() { inv = GetComponent <UI_Inventory>(); itemsList = GetComponent <UI_ItemsList>(); htbar = GetComponent <UI_Hotbar>(); GameObject[] allGO = GameObject.FindObjectsOfType <GameObject>(); foreach (GameObject obj in allGO) { if (obj.GetComponent <UI_Container>() != null) { containers.Add(obj); } } }
void Awake() { //assign crafting and itemslist scripts craft = inv.GetComponent <UI_Crafting>(); items = inv.GetComponent <UI_ItemsList>(); }