CharacterAnimator.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using KairoEngine.Core;
  5. namespace KairoEngine.CharacterSystem
  6. {
  7. public class CharacterAnimator : MonoBehaviour
  8. {
  9. private CharacterController character;
  10. public void Start()
  11. {
  12. character = gameObject.GetComponentInParent<CharacterController>();
  13. if(character == null) Debug.LogError("Missing character controller for " + gameObject.transform.parent.name);
  14. }
  15. public void FootR()
  16. {
  17. if(character == null) return;
  18. GenericEvents.Trigger(character.unique_name + "-AnimationStepDone");
  19. }
  20. public void FootL()
  21. {
  22. if(character == null) return;
  23. GenericEvents.Trigger(character.unique_name + "-AnimationStepDone");
  24. }
  25. public void Hit()
  26. {
  27. if(character == null) return;
  28. GenericEvents.Trigger(character.unique_name + "-AnimationHit");
  29. }
  30. public void Shoot()
  31. {
  32. }
  33. public void MeleeEnd()
  34. {
  35. if(character == null) return;
  36. GenericEvents.Trigger(character.unique_name + "-AnimationMeleeEnd");
  37. }
  38. }
  39. }