CharacterStopMoveCommand.cs 663 B

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. namespace KairoEngine.CharacterSystem
  6. {
  7. public class CharacterStopMoveCommand : ICommand
  8. {
  9. CharacterController character;
  10. public CharacterStopMoveCommand(CharacterController character)
  11. {
  12. this.character = character;
  13. }
  14. public void Execute()
  15. {
  16. if(character == null) return;
  17. ActionController actionController = character.GetComponent<ActionController>();
  18. actionController.CancelAction(typeof(CharacterMoveToPositionAction).ToString());
  19. }
  20. }
  21. }