DropItemCommand.cs 857 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. using KairoEngine.Inventory;
  6. namespace KairoEngine.CharacterSystem
  7. {
  8. public class DropItemCommand : ICommand
  9. {
  10. ItemRef itemRef;
  11. ItemContainer itemContainer;
  12. public DropItemCommand(ItemContainer itemContainer, ItemRef itemRef)
  13. {
  14. this.itemContainer = itemContainer;
  15. this.itemRef = itemRef;
  16. }
  17. public void Execute()
  18. {
  19. DropItemAction action = new DropItemAction(itemContainer, itemRef);
  20. ActionController actionController = itemContainer.GetComponent<ActionController>();
  21. actionController.AddAction(action);
  22. if(actionController.HasAction(action) == false)
  23. {
  24. }
  25. }
  26. }
  27. }