ZombieIdleAction.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Events;
  5. using KairoEngine.Core;
  6. namespace KairoEngine.CharacterSystem
  7. {
  8. /// <summary>
  9. /// Action to move a character in a certain direction and speed.
  10. /// </summary>
  11. public class ZombieIdleAction : IAction
  12. {
  13. CharacterController character; // Reference to the character that will perform the action
  14. int varient;
  15. bool done = false;
  16. /// <summary>
  17. /// Action that will make a character play an zombie idle animation.
  18. /// </summary>
  19. /// <param name="character">The CharacterController performing the action.</param>
  20. /// <param name="varient">Use numbers 1 to 8 for different animations.</param>
  21. public ZombieIdleAction(CharacterController character, int varient)
  22. {
  23. this.character = character;
  24. this.varient = varient;
  25. }
  26. public void Start()
  27. {
  28. float v = (float)varient;
  29. character.animator.SetFloat("ZombieIdleVarient", v);
  30. character.animator.SetFloat("vertical", 0);
  31. }
  32. public void Update() { }
  33. public void End()
  34. {
  35. done = true;
  36. }
  37. public bool IsDone()
  38. {
  39. return done;
  40. }
  41. }
  42. }