CharacterUnequipItemAction.cs 943 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. namespace KairoEngine.CharacterSystem
  6. {
  7. public class CharacterUnequipItemAction : IAction
  8. {
  9. CharacterController character; // Reference to the character that will move
  10. // Constructor
  11. public CharacterUnequipItemAction(CharacterController character)
  12. {
  13. this.character = character;
  14. }
  15. public void Start()
  16. {
  17. if(character.HasEquipedItem())
  18. {
  19. GameObject.Destroy(character.GetEquipedGameObject());
  20. character.SetEquipedItem(null);
  21. character.SetEquipedGameObject(null);
  22. character.animator.SetInteger("Mode", 0);
  23. }
  24. }
  25. public void Update() { }
  26. public void End() { }
  27. public bool IsDone()
  28. {
  29. return true;
  30. }
  31. }
  32. }