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>
This commit is contained in:
1 parent
3da613e1a1
commit
f758c96dc5
8 files changed
+220
-427
No files matched your search
@@ -1,29 +1,24 @@
|
||||
/// <summary>
|
||||
/// Base class for a high-level game mode (state) handled by
|
||||
/// <see cref="GameModeManager"/>. A mode configures the relevant scene systems
|
||||
/// when it becomes active (<see cref="Enter"/>), can clean up when it is left
|
||||
/// (<see cref="Exit"/>) and may run per-frame logic in <see cref="Tick"/>.
|
||||
///
|
||||
/// Modes are plain C# classes (not MonoBehaviours). To add a new mode, derive
|
||||
/// from this class and register an instance in GameModeManager.BuildModes().
|
||||
/// 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
|
||||
{
|
||||
/// <summary>The owning manager, providing access to the controlled systems.</summary>
|
||||
protected GameModeManager Manager { get; private set; }
|
||||
|
||||
/// <summary>Human-readable name (shown in logs / debug UI).</summary>
|
||||
/// <summary>Human-readable name (shown in logs).</summary>
|
||||
public abstract string DisplayName { get; }
|
||||
|
||||
/// <summary>Wires the mode to its manager. Called once during registration.</summary>
|
||||
internal void Bind(GameModeManager manager) => Manager = manager;
|
||||
|
||||
/// <summary>Called once when this mode becomes the active mode.</summary>
|
||||
/// <summary>Called once when this mode becomes active.</summary>
|
||||
public virtual void Enter() { }
|
||||
|
||||
/// <summary>Called once when this mode stops being the active mode.</summary>
|
||||
/// <summary>Called once when this mode stops being active.</summary>
|
||||
public virtual void Exit() { }
|
||||
|
||||
/// <summary>Called every frame while this mode is the active mode.</summary>
|
||||
/// <summary>Called every frame while this mode is active.</summary>
|
||||
public virtual void Tick() { }
|
||||
}
|
||||
Reference in new issue
Block a user