ZombieIdleCommand.cs 804 B

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