42 lines
1.8 KiB
C#
42 lines
1.8 KiB
C#
using UnityEngine;
|
|
|
|
namespace Unheimlich.Core
|
|
{
|
|
/// <summary>
|
|
/// Central event system for player actions.
|
|
/// Decouples player components from each other.
|
|
/// </summary>
|
|
public static class PlayerEvents
|
|
{
|
|
// Movement events
|
|
public static event System.Action OnJump;
|
|
public static event System.Action<Vector3, Quaternion> OnTeleport;
|
|
|
|
// Camera events
|
|
public static event System.Action<float> OnCameraShake;
|
|
|
|
// Diapason events
|
|
public static event System.Action OnDiapasonEquip;
|
|
public static event System.Action OnDiapasonUnequip;
|
|
public static event System.Action OnDiapasonTap;
|
|
|
|
// Context events
|
|
public static event System.Action OnEnterDialogue;
|
|
public static event System.Action OnExitDialogue;
|
|
public static event System.Action OnEnterListening;
|
|
public static event System.Action OnExitListening;
|
|
|
|
// Trigger methods
|
|
public static void TriggerJump() => OnJump?.Invoke();
|
|
public static void TriggerTeleport(Vector3 position, Quaternion rotation) => OnTeleport?.Invoke(position, rotation);
|
|
public static void TriggerCameraShake(float intensity) => OnCameraShake?.Invoke(intensity);
|
|
public static void TriggerDiapasonEquip() => OnDiapasonEquip?.Invoke();
|
|
public static void TriggerDiapasonUnequip() => OnDiapasonUnequip?.Invoke();
|
|
public static void TriggerDiapasonTap() => OnDiapasonTap?.Invoke();
|
|
public static void TriggerEnterDialogue() => OnEnterDialogue?.Invoke();
|
|
public static void TriggerExitDialogue() => OnExitDialogue?.Invoke();
|
|
public static void TriggerEnterListening() => OnEnterListening?.Invoke();
|
|
public static void TriggerExitListening() => OnExitListening?.Invoke();
|
|
}
|
|
}
|