public void UseItem(GameObject usingObject)
        {
            try
            {
                BattleItem usingItem = usingObject.GetComponent <BattleItem>();

                int index =
                    _itemList.FindIndex(item => { return(item._itemName == usingItem._itemName); });
                _previousItemName = usingItem._itemName;

                PokemonBattleManager.Instance.UseItem(usingItem._itemEvent);

                _itemList[index].SetCount(-1);
                _itemList[index].UpdateText();

                if (usingItem._itemCount <= 0)
                {
                    RemoveItem(index);
                }
            }
            catch (System.ArgumentNullException error)
            {
                Debug.Log("오류가 발생했습니다 : " + error.Message);
            }
        }
 // 아이템 삭제(아이템 개체를 통해)
 public void RemoveItem(BattleItem removedItem)
 {
     try
     {
         int index =
             _itemList.FindIndex(item => { return(item._itemName == removedItem._itemName); });
         RemoveItem(index);
     }
     catch (System.ArgumentNullException error)
     {
         Debug.Log("오류가 발생했습니다 : " + error.Message);
     }
 }
        public void AddItem(string itemName, string itemCaption, int itemCount, BattleItem.ItemType itemType, UnityAction <Pokemon, Pokemon> itemEvent)
        {
            if (_itemPrefab == null)
            {
                Debug.Log("경고 : 아이템 프리팹이 존재하지 않습니다.");
                return;
            }

            GameObject newObject = Instantiate(_itemPrefab, _contentObject);
            BattleItem newItem   = newObject.GetComponent <BattleItem>();

            BattleEvent newItemEvent = new BattleEvent();

            newItemEvent.AddListener(itemEvent);

            newItem.SetValues(itemName, itemCaption, itemCount, itemType, newItemEvent);
            newItem.UpdateText();
            newItem.AddEvents();

            SetFirstItem();

            _itemList.Add(newItem);
        }