CharacterRelaxIdleCommand.cs 758 B

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