using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.Core; using KairoEngine.Inventory; namespace KairoEngine.CharacterSystem { public class UseInstantEffectItemCommand : ICommand { ItemContainer itemContainer; ItemRef itemRef; public UseInstantEffectItemCommand(ItemContainer itemContainer, ItemRef itemRef) { this.itemContainer = itemContainer; this.itemRef = itemRef; } public void Execute() { UseInstantEffectItemAction action = new UseInstantEffectItemAction(itemContainer, itemRef); ActionController actionController = itemContainer.GetComponent(); if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }