private void Update() { player = GameObject.FindWithTag("PlayerControl").GetComponent <playerController>(); inventory = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <inventorySystem>(); LSystem = GameObject.FindWithTag("GameController").GetComponent <lifeSystem>(); if (isOpen == true & anim != null) { anim.SetBool("isOpen", true); IC.SetActive(false); } if (isOpen == true) { IC.SetActive(false); } if (inventory != null) { inventOn = true; } else { inventOn = false; } if (thisIsItemVariant == true) { this.gameObject.tag = itemArray[random].tag; } else if (thisIsItemVariant == false) { this.gameObject.tag = itemButton.tag; } Debug.Log(randomR); Debug.Log(this.gameObject.tag); }
public void Update() { inventory = GameObject.FindWithTag("Player").GetComponentInChildren <inventorySystem>(); if (transform.childCount <= 0 && inventory != null) { inventory.isFull[i] = false; } }
private void Update() { inventory = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <inventorySystem>(); if (inventOn) { for (int i = 0; i < inventory.slots.Length; i++) { if (inventory.isFull[i] == false) { inventory.isFull[i] = true; Instantiate(itemButton, inventory.slots[i].transform); Destroy(gameObject); break; } } } }