PlayerEvents.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine
  5. {
  6. public class PlayerEvents
  7. {
  8. public static event System.Action<Vector3> OnPositionChange;
  9. public static event System.Action<GameObject> OnHoverTarget;
  10. public static event System.Action<Vector3, Quaternion> OnSetPlayerPosition;
  11. public static void PositionChange(Vector3 position)
  12. {
  13. if(OnPositionChange != null)
  14. {
  15. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  16. OnPositionChange(position);
  17. }
  18. }
  19. public static void HoverTarget(GameObject target)
  20. {
  21. if(OnHoverTarget != null)
  22. {
  23. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  24. OnHoverTarget(target);
  25. }
  26. }
  27. public static void SetPlayerPosition(Vector3 targetPosition, Quaternion targetRotation)
  28. {
  29. if(OnSetPlayerPosition != null)
  30. {
  31. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  32. OnSetPlayerPosition(targetPosition, targetRotation);
  33. }
  34. }
  35. }
  36. }