ShootCommand.cs 640 B

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