Пример #1
0
 private void CheckItemExists(int arg1)
 {
     for (int i = 0; i < itemIDEvents.Count; i++)
     {
         CheckItemIDEvent check = itemIDEvents[i];
         CheckItemID(check);
     }
 }
Пример #2
0
 private void CheckItemID(CheckItemIDEvent check)
 {
     if (check.Check(itemManager))
     {
         check.onContainItem.Invoke();
     }
     else
     {
         check.onNotContainItem.Invoke();
     }
 }
Пример #3
0
 private void CheckIsEquipped(vEquipArea arg0, vItem arg1)
 {
     for (int i = 0; i < itemIDEvents.Count; i++)
     {
         CheckItemIDEvent check = itemIDEvents[i];
         CheckItemID(check);
     }
     for (int i = 0; i < itemTypeEvents.Count; i++)
     {
         CheckItemTypeEvent check = itemTypeEvents[i];
         CheckItemType(check);
     }
 }
Пример #4
0
        public void CheckOnTrigger(Collider collider)
        {
            if (collider != null)
            {
                itemManager = collider.gameObject.GetComponent <vItemManager>();

                if (itemManager)
                {
                    for (int i = 0; i < itemIDEvents.Count; i++)
                    {
                        CheckItemIDEvent check = itemIDEvents[i];
                        CheckItemID(check);
                    }
                }
            }
        }
Пример #5
0
        private void CheckItemID(CheckItemIDEvent check)
        {
            bool _isEquipped = check._itemsID.Exists(t => itemManager.ItemIsEquipped(t));

            if (_isEquipped != check.isEquipped)
            {
                check.isEquipped = _isEquipped;
                if (check.isEquipped)
                {
                    check.onIsItemEquipped.Invoke();
                }
                else
                {
                    check.onIsItemUnequipped.Invoke();
                }
            }
        }