Weapons/PeachLauncher/PeachOverlayBridge.cs
/// <summary>
/// Plain C# bridge for the peach splat screen overlay.
/// PeachSplat.cs calls this directly (no Razor type resolution issues).
/// The PeachSplatOverlay.razor file reads state from this singleton each frame.
///
/// Place PeachSplatOverlay.razor on the HUD / camera GameObject in the scene —
/// it will register itself as the listener on startup.
/// </summary>
public static class PeachOverlayBridge
{
public static bool IsGiant { get; private set; } = false;
public static float Target { get; private set; } = 0f;
public static float Speed { get; private set; } = 0.6f;
public static float Linger { get; private set; } = 0f;
public static bool Exiting { get; private set; } = false;
public static void EnterZone( bool isGiant, float intensity, float fadeSpeed )
{
IsGiant = isGiant;
Target = intensity;
Speed = fadeSpeed;
Exiting = false;
Linger = 0f;
}
public static void ExitZone( float lingerTime, float fadeSpeed )
{
Linger = lingerTime;
Speed = fadeSpeed;
Exiting = true;
}
/// <summary>Called each frame by the Razor component to advance linger countdown.</summary>
public static void Tick( float delta )
{
if ( !Exiting ) return;
Linger -= delta;
if ( Linger <= 0f )
Target = 0f;
}
/// <summary>Called once the Razor component has fully faded out.</summary>
public static void OnFullyFaded()
{
Exiting = false;
Target = 0f;
}
}