using KairoEngine.Core; using KairoEngine.Inventory; namespace KairoEngine.CharacterSystem { public class EquipItemCommand : ICommand { ItemRef itemRef; CharacterController character; public EquipItemCommand(ItemRef itemRef, CharacterController character) { this.itemRef = itemRef; this.character = character; } public void Execute() { CharacterEquipItemAction action = new CharacterEquipItemAction(itemRef, character); ActionController actionController = character.GetComponent(); if(actionController == null) return; if(actionController.HasAction(action) == false) { actionController.AddAction(action); } } } }