//Checks if the item is placed in the right slot according to its tag //called on item public void PlacedInCheck() { ItemManager_sz itm = transform.parent.GetComponentInParent <ItemManager_sz>(); if (itm) { if (transform.parent.GetComponentInParent <ItemManager_sz>().isEquipSlot == true && transform.parent.GetComponentInParent <Transform>().tag == this.gameObject.tag) { Debug.Log("Place In Right Slot"); if (OnPlacedOnRightEquipSlot != null) { OnPlacedOnRightEquipSlot.Invoke(); } } else { Debug.Log("Place In Wrong Slot"); OnPlacedWrongSlot.Invoke(); } } }
void Awake() { itemManager = GetComponent <ItemManager_sz>(); }