add initial project files and configurations, including EventBus, systems, and resources
This commit is contained in:
30
Code/Core/EventBus.cs
Normal file
30
Code/Core/EventBus.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using MaxEffort.Code.Data;
|
||||
|
||||
namespace MaxEffort.Code.Core;
|
||||
|
||||
public static class EventBus
|
||||
{
|
||||
public static event Action<float> OnLiftEffortApplied; // Player pressed space
|
||||
public static event Action OnFocusRelease; // Player stopped to look around
|
||||
|
||||
public static event Action<float> OnFocusChanged; // 0.0 to 1.0 (Tunnel Intensity)
|
||||
public static event Action<bool> OnLiftCompleted; // true = Success, false = Fail
|
||||
public static event Action<float> OnLiftProgress; // 0.0 to 1.0 (Lift Progress)
|
||||
public static event Action<float> OnLiftVisualHeight;
|
||||
public static event Action<float> OnCameraTrauma;
|
||||
|
||||
public static event Action<HazardType> OnHazardSpawned;
|
||||
public static event Action<HazardType> OnHazardResolved;
|
||||
|
||||
public static void PublishLiftEffortApplied(float strength) => OnLiftEffortApplied?.Invoke(strength);
|
||||
public static void PublishFocusChanged(float intensity) => OnFocusChanged?.Invoke(intensity);
|
||||
public static void PublishLiftCompleted(bool success) => OnLiftCompleted?.Invoke(success);
|
||||
public static void PublishLiftProgress(float progress) => OnLiftProgress?.Invoke(progress);
|
||||
|
||||
public static void PublishFocusRelease() => OnFocusRelease?.Invoke();
|
||||
public static void PublishHazardSpawned(HazardType type) => OnHazardSpawned?.Invoke(type);
|
||||
public static void PublishHazardResolved(HazardType type) => OnHazardResolved?.Invoke(type);
|
||||
public static void PublishLiftVisualHeight(float height) => OnLiftVisualHeight?.Invoke(height);
|
||||
public static void PublishCameraTrauma(float trauma) => OnCameraTrauma?.Invoke(trauma);
|
||||
}
|
||||
1
Code/Core/EventBus.cs.uid
Normal file
1
Code/Core/EventBus.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c2v0ppfl3wy8a
|
||||
Reference in New Issue
Block a user