Files
chameleon/Assets/Scripts/GameMode.cs
T
adminandClaude Opus 4.8 f758c96dc5 Trim comments and use implicit null checks for Unity objects
Reduce comments to non-obvious "why" notes and convert UnityEngine.Object
null checks to implicit bool (if (obj) / if (!obj)). Input System devices
(Mouse.current, Keyboard.current) and plain arrays keep explicit != null.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:26:41 +02:00

25 lines
906 B
C#

/// <summary>
/// Base class for a high-level game mode handled by <see cref="GameModeManager"/>.
/// Modes are plain C# classes (not MonoBehaviours); Enter/Exit/Tick are driven
/// manually by the manager. Derive from this and register an instance in
/// GameModeManager.BuildModes().
/// </summary>
public abstract class GameMode
{
protected GameModeManager Manager { get; private set; }
/// <summary>Human-readable name (shown in logs).</summary>
public abstract string DisplayName { get; }
internal void Bind(GameModeManager manager) => Manager = manager;
/// <summary>Called once when this mode becomes active.</summary>
public virtual void Enter() { }
/// <summary>Called once when this mode stops being active.</summary>
public virtual void Exit() { }
/// <summary>Called every frame while this mode is active.</summary>
public virtual void Tick() { }
}