Scene Director
The SceneDirector
is responsible for driving high-level scene logic, maintaining scene services and holding scene specific custom data. All main scenes have exactly one single instance of the SceneDirector
.
This script is designed to be inherited.
Examples
Here are some examples of director scripts inheriting from SceneDirector
.
Menu Director
The MenuDirector
is responsible for driving Menu scene and holds the definitions of all selectable gameplay scenes.
Gameplay Director
The GameplayDirector
is responsible for:
- driving the gameplay scene it is attached to, this includes -but is not limited to- creating and ticking the
SimulationContext
, reacting to simulation callbacks and managing the replay functionality; and, - holding data on how the scene is to be handled in standalone mode (i.e. when the scene is started directly in editor without going through the menu).
Creating a New Gameplay Scene
This is the step-by-step procedure to create a new Gameplay Scene in the FPS Template.
- Create empty scene.
- Add environment visuals, colliders, etc ...
- Add a GameObject with the
MapData
component. - Add a GameObject with
GameplayDirector
component. - Add GameObject with
NavMeshSurface
component. - Add GameObject with
MapNavMeshDefinition
component, link it with theNavMeshSurface
component created in the previous step. - Add scene entities (e.g. SpawnPoints, Waypoints, ...).
- Bake the navigation via the
NavMeshSurface
component. - Import the NavMesh from Unity by clicking on the
Import from Unity
button on theMapNavMeshDefinition
component. - Create a
Map
asset via theQantum > Map
menu and link it with theMapData
component. - Create a
GameplayData
asset via theQuantum > GameplayData
menu and link it theUser Asset
field in theMapData
component. - Set the properties in the
Map
asset (can also be done with theMapData component
). - Bake the
MapData
component information via its included buttons. - Set up the
Standalone Setup
properties on theGameplayDirector
component to run the gameplay scene directly from scene editor.