CancelActionsCommand.cs 634 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. namespace KairoEngine.CharacterSystem
  6. {
  7. public class CancelAtionsCommand : ICommand
  8. {
  9. CharacterController character;
  10. public CancelAtionsCommand(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. if(actionController != null) actionController.CancelActions();
  19. }
  20. }
  21. }