예제 #1
0
        //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();
                }
            }
        }
예제 #2
0
 void Awake()
 {
     itemManager = GetComponent <ItemManager_sz>();
 }