123456789101112131415161718192021222324252627282930 |
- 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<ActionController>();
- if(actionController.HasAction(action) == false)
- {
- actionController.AddAction(action);
- }
- }
- }
- }
|