Class SurvivorsSceneBootstrap
- Namespace
- SurvivorsMaker.Presentation
- Assembly
- SurvivorsMaker.Presentation.dll
One component that turns a scene into a playable game: it connects the session (SurvivorsGame), input, the world view, the UI, music and interface sounds to your content and catalogs. Empty scene references are found in the scene or created. Both run modes work in one scene: the menu's mode toggle switches between ArenaSettings and FieldSettings. Customise from code with an ISceneBootstrapExtension component on the same GameObject.
[DefaultExecutionOrder(-50)]
[AddComponentMenu("Survivor Roguelite Maker/Survivors Scene Bootstrap")]
public sealed class SurvivorsSceneBootstrap : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourSurvivorsSceneBootstrap
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
SurvivorsSceneBootstrap()
public SurvivorsSceneBootstrap()
Fields
AllowModeSwitch
[Tooltip("Show the menu's arena/field toggle.")]
public bool AllowModeSwitch
Field Value
ArenaSettings
[Tooltip("Rules for arena-mode runs (shop between waves). Empty = the content's settings.")]
public GameSettingsAsset ArenaSettings
Field Value
Camera
Scene camera; unassigned finds one or creates an orthographic camera.
[Tooltip("Scene camera; unassigned finds one or creates an orthographic camera.")]
public Camera Camera
Field Value
- Camera
CameraFollowsPlayer
[Tooltip("Add CameraFollow to the camera so it tracks the player inside the arena.")]
public bool CameraFollowsPlayer
Field Value
Content
Required content catalog used by the configured scene.
[Tooltip("Required content catalog used by the configured scene.")]
[Header("Content")]
public ContentAsset Content
Field Value
CreateMissingUi
[Tooltip("Build the default UI from code when the scene has no GameUiRoot.")]
public bool CreateMissingUi
Field Value
CreatedCameraSize
[Tooltip("Orthographic size of a camera created by the bootstrap.")]
[Min(0.01)]
public float CreatedCameraSize
Field Value
DefaultPlayerView
[Tooltip("View catalog id of the player when a character has no entry of its own. Empty = the first character's id.")]
public string DefaultPlayerView
Field Value
FieldSettings
[Tooltip("Rules for field-mode runs (level-ups during waves). Empty = the content's settings.")]
public GameSettingsAsset FieldSettings
Field Value
Game
Session component; unassigned finds one in the scene or creates it.
[Tooltip("Session component; unassigned finds one in the scene or creates it.")]
[Header("Scene (empty = found in the scene or created)")]
public SurvivorsGame Game
Field Value
Input
[Tooltip("Any component implementing IPlayerInput. Empty = InputSystemPlayerInput.")]
public MonoBehaviour Input
Field Value
- MonoBehaviour
Mode
[Tooltip("The mode the menu starts on.")]
public RunMode Mode
Field Value
Seed
[Tooltip("Fixed run seed. Zero chooses a time-based seed for each run.")]
public uint Seed
Field Value
Sounds
Sound and music catalog; unassigned leaves the scene silent.
[Tooltip("Sound and music catalog; unassigned leaves the scene silent.")]
public SoundCatalogAsset Sounds
Field Value
Text
[Tooltip("Optional translations for UI text and content names.")]
public LocalizedTextAsset Text
Field Value
Ui
Game UI root; unassigned finds one or creates it when Create Missing UI is on.
[Tooltip("Game UI root; unassigned finds one or creates it when Create Missing UI is on.")]
public GameUiRoot Ui
Field Value
View
World renderer; unassigned finds one in the scene or creates it.
[Tooltip("World renderer; unassigned finds one in the scene or creates it.")]
public WorldView View
Field Value
Views
Definition-to-view catalog; unassigned uses procedural fallback visuals.
[Tooltip("Definition-to-view catalog; unassigned uses procedural fallback visuals.")]
[Header("Look and sound")]
public ViewCatalogAsset Views
Field Value
Properties
Configured
True after ConfigureScene() ran.
public bool Configured { get; }
Property Value
Music
public MusicPlayer Music { get; }
Property Value
PlayerInput
The input source given to the session.
public IPlayerInput PlayerInput { get; }
Property Value
SoundPlayer
public SoundPlayer SoundPlayer { get; }
Property Value
Systems
The run systems the session uses (after ConfigureSystems(RunSystems)).
public RunSystems Systems { get; }
Property Value
UiSounds
public UiSoundBinder UiSounds { get; }
Property Value
Methods
ApplyContent()
public void ApplyContent()
ConfigureScene()
Finds or creates every scene part and wires it. Start calls it once; call it yourself after changing references from code (before a run begins). Throws when Content is missing.
public void ConfigureScene()
Validate()
Problems that stop the scene from working (missing content, characters, arenas or catalogs). Empty = ready. Content validation itself is Validate().
public List<string> Validate()
Returns
Events
SceneConfigured
Raised at the end of ConfigureScene().
public event Action<SurvivorsSceneBootstrap> SceneConfigured