void Awake() { if (instance != null) { Debug.LogWarning("More than 1 instance of Inventory"); return; } instance = this; }
// Use this for initialization void Start() { spellBar = Spell_Bar.instance; gameManager = GameManager.instance; playerInfo = Player_Information.instance; spellUI = Spell_Bar_UI.instance; enemyList = GameObject.FindGameObjectsWithTag("Enemy"); walkableTilemap = gameManager.walkableTilemap; wallTilemap = gameManager.wallTilemap; }
// Use this for initialization void Start() { spellBar = Spell_Bar.instance; //listening for the delegate to get triggered //and saying UpdateUI function is listening spellBar.OnItemChangedCallBack += UpdateUI; //finds all children to this parent //and looks for the InventorySlot script on the children slots = itemsParent.GetComponentsInChildren <Spell_Bar_Slot>(); }