UnequipItemCommand.cs 693 B

12345678910111213141516171819202122232425
  1. using KairoEngine.Core;
  2. using KairoEngine.Inventory;
  3. namespace KairoEngine.CharacterSystem
  4. {
  5. public class UnequipItemCommand : ICommand
  6. {
  7. CharacterController character;
  8. public UnequipItemCommand(CharacterController character)
  9. {
  10. this.character = character;
  11. }
  12. public void Execute()
  13. {
  14. CharacterUnequipItemAction action = new CharacterUnequipItemAction(character);
  15. ActionController actionController = character.GetComponent<ActionController>();
  16. if(actionController.HasAction(action) == false)
  17. {
  18. actionController.AddAction(action);
  19. }
  20. }
  21. }
  22. }