Integration of the octo input system and centralization of player values
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82279ebe597d0b84eb1f7ab31139587d
|
||||
Reference in New Issue
Block a user