CutsceneController - alexneargarder/Broforce-Docs GitHub Wiki
CutsceneController
Table of Contents
- Unity Lifecycle & Setup
- Cutscene Management
- Boss Cutscenes
- Player Control
- Cutscene Types & Mapping
- Singleton Pattern
Unity Lifecycle & Setup
Methods
protected virtual void Awake()
Initializes the CutsceneController singleton instance and subscribes to scene change events
public void OnDestroy()
Cleans up the singleton instance and unsubscribes from scene change events
Fields
public Camera letterBoxCamera
Camera used for letterbox effect during cutscenes
Cutscene Management
Methods
public void CloseAllCutscenes()
Ends all active cutscenes including both bro and boss intro roots
public static void LoadCutScene(CutsceneName name, float delay)
Loads and plays a cutscene with an optional delay. Handles pausing and special cases like offline mode
Parameters:
- CutsceneName name: The cutscene to load
- float delay: Time in seconds to wait before starting the cutscene
private IEnumerator LoadCutSceneRoutine(CutsceneName cutsceneName, float delay)
Coroutine that handles the actual cutscene loading process, including intro roots and scene loading
Parameters:
- CutsceneName cutsceneName: The cutscene to load
- float delay: Time in seconds to wait before starting
Returns:
IEnumerator
: IEnumerator for coroutine execution
private void SceneChange(Scene oldScene, Scene newScene)
Handles scene change events by closing any active cutscenes
Parameters:
- Scene oldScene: The scene being unloaded
- Scene newScene: The newly loaded scene
Properties
public static bool InCutscene { get; set; }
Gets whether a cutscene is currently in progress
Fields
public CutsceneIntroRoot bossIntroRoot
Root object for managing boss intro cutscenes
public CutsceneIntroRoot broIntroRoot
Root object for managing bro character intro cutscenes
private static bool cutSceneInProgress
Static flag indicating whether any cutscene is currently playing
Boss Cutscenes
Methods
public void InstantiateSatanHeliCutScene()
Creates and positions the Satan helicopter cutscene relative to Satan's position
public void RevealAlienBoss()
Creates and displays the alien boss reveal cutscene UI element on the UI camera
Fields
public AlienBossReveal revealScene
Prefab reference for the alien boss reveal cutscene
public SatanHeliCutscene satanHeliCutscene
Prefab reference for the Satan helicopter cutscene
Player Control
Methods
public static void HoldPlayersStill(bool hold)
Controls whether players can move during cutscenes
Parameters:
- bool hold: True to prevent player movement, false to allow it
public static bool PlayersCanMove()
Checks if players are allowed to move (not held still by a cutscene)
Returns:
bool
: True if players can move, false if they're being held still
Fields
public static bool holdPlayersStill
Static flag controlling whether players are prevented from moving
Cutscene Types & Mapping
Methods
public static string GetCustsceneSceneName(CutsceneName cutscene)
Maps a CutsceneName enum value to its corresponding Unity scene name. Handles special cases like hard mode variations
Parameters:
- CutsceneName cutscene: The cutscene enum value to map
Returns:
string
: The Unity scene name for the cutscene, or empty string if not found
Singleton Pattern
Methods
public static Vector3 GetPosition()
Gets the world position of the CutsceneController instance
Returns:
Vector3
: The transform position of the controller
public static bool HasInstance()
Checks if a CutsceneController instance exists
Returns:
bool
: True if an instance exists, false otherwise
Properties
public static CutsceneController Instance { get; set; }
Gets the singleton instance of the CutsceneController
Fields
protected static CutsceneController instance
Protected static reference to the singleton instance