/*void OnTriggerEnter2D(Collider2D otherObj) { * if (otherObj.tag == "collectable_items") { * otherObj.gameObject.SetActive (false); * itemCode = 1; * DATA.itemCode = itemCode; * } * if (itemCode == 1) { * //GameObject.Find ("Key").GetComponent<Renderer> ().enabled = true; * GameObject.Find("Key").SetActive(true); * } else { * Debug.Log ("outro item"); * } * }*/ public static void CheckItemStatus(int pItemID) { GameObject Item = GameObject.Find("HUDCanvas"); GameObject Inventory = Item.transform.Find("Inventory").gameObject; GameObject ItemSpace = Inventory.transform.Find("Items_space").gameObject; Debug.Log("Item code: " + pItemID); if (pItemID == 1) { GameObject ActiveItem = ItemSpace.transform.Find("ItemKey").gameObject; ActiveItem.SetActive(true); LoadScene.StoraItemsList(pItemID); //GameObject.Find("Key").SetActive(true); } }