Class SceneManagers
Manages SceneManager instances and allows the user to access them.
Namespace: Evergine.Framework.Managers
Assembly: Evergine.Framework.dll
Syntax
public class SceneManagers
Remarks
Registered SceneManager instances that inherit from UpdatableSceneManager will be updated automatically by this instance. This update order depends on the order in which SceneManager instances were registered (first registered, first to be updated, and so on).
Constructors
SceneManagers(Scene)
Initializes a new instance of the SceneManagers class.
Declaration
public SceneManagers(Scene scene)
Parameters
| Type | Name | Description |
|---|---|---|
| Scene | scene | The scene. |
Properties
AssetSceneManager
Gets the entity manager.
Declaration
public AssetSceneManager AssetSceneManager { get; }
Property Value
| Type | Description |
|---|---|
| AssetSceneManager |
BehaviorManager
Gets the behavior manager.
Declaration
public BehaviorManager BehaviorManager { get; }
Property Value
| Type | Description |
|---|---|
| BehaviorManager |
EntityManager
Gets the entity manager.
Declaration
public EntityManager EntityManager { get; }
Property Value
| Type | Description |
|---|---|
| EntityManager |
EnvironmentManager
Gets the environment manager.
Declaration
public EnvironmentManager EnvironmentManager { get; }
Property Value
| Type | Description |
|---|---|
| EnvironmentManager |
PhysicManager3D
Gets the behavior manager.
Declaration
public PhysicManager3D PhysicManager3D { get; }
Property Value
| Type | Description |
|---|---|
| PhysicManager3D |
RegisteredManagers
Gets the scene managers of the registered scene managers.
Declaration
public IEnumerable<SceneManager> RegisteredManagers { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<SceneManager> |
RenderManager
Gets the render manager.
Declaration
public BaseRenderManager RenderManager { get; }
Property Value
| Type | Description |
|---|---|
| BaseRenderManager |
Scene
Gets the associated scene.
Declaration
public Scene Scene { get; }
Property Value
| Type | Description |
|---|---|
| Scene |
Methods
ActivateManagers()
Activate scene managers.
Declaration
public void ActivateManagers()
Remarks
This method initializes only new scene managers, not yet initialized.
AddManager(SceneManager)
Registers a SceneManager instance.
Declaration
public bool AddManager(SceneManager sceneManager)
Parameters
| Type | Name | Description |
|---|---|---|
| SceneManager | sceneManager | The instance to register. |
Returns
| Type | Description |
|---|---|
| bool | True if the sceneManager has been successfully registered. |
Remarks
If the instance to register inherits from UpdatableSceneManager, this class will handle the update automatically.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If sceneManager is null. |
| ArgumentException | If sceneManager is disposed or already attached. |
| InvalidOperationException | If a SceneManager of the same type is already registered. |
AddManager<T>(T)
Registers a SceneManager instance.
Declaration
public bool AddManager<T>(T sceneManager) where T : SceneManager
Parameters
| Type | Name | Description |
|---|---|---|
| T | sceneManager | The instance to register. |
Returns
| Type | Description |
|---|---|
| bool | True if the sceneManager has been successfully registered. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the SceneManager. |
Remarks
If the instance to register inherits from UpdatableSceneManager, this class will handle the update automatically.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If sceneManager is null. |
| ArgumentException | If sceneManager is disposed or already attached. |
| InvalidOperationException | If a SceneManager with the same type is already registered. |
AttachManagers()
Activate scene managers.
Declaration
public void AttachManagers()
Remarks
This method initializes only new scene managers that have not been initialized yet.
DetachManager(SceneManager)
Detaches the SceneManager instance. Removes it from SceneManagers but does not destroy it.
Declaration
public bool DetachManager(SceneManager sceneManager)
Parameters
| Type | Name | Description |
|---|---|---|
| SceneManager | sceneManager | The sceneManager to unregister. |
Returns
| Type | Description |
|---|---|
| bool | True if the sceneManager has been successfully unregistered. |
Remarks
The unregistered SceneManager will be disposed.
DrawSceneManagers(TimeSpan)
Updates the registered BaseRenderManager instances.
Declaration
public void DrawSceneManagers(TimeSpan gameTime)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | gameTime | The game time. |
FindManager(Type, bool)
Gets a SceneManager instance.
Declaration
public SceneManager FindManager(Type sceneManagerType, bool isExactType = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | sceneManagerType | Type of the SceneManager to get. |
| bool | isExactType | Whether to match the exact type. |
Returns
| Type | Description |
|---|---|
| SceneManager | The SceneManager instance found, or null if there is not a SceneManager with the selected type registered. |
FindManager<T>(bool)
Gets a SceneManager instance.
Declaration
public T FindManager<T>(bool isExactType = false) where T : SceneManager
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isExactType | Whether to match the exact type. |
Returns
| Type | Description |
|---|---|
| T | The SceneManager instance found, or null if there was no SceneManager registered with the selected type. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the SceneManager to get. |
FindManagers(Type, bool)
Gets a collection of SceneManager instances.
Declaration
public IEnumerable<SceneManager> FindManagers(Type sceneManagerType, bool isExactType = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | sceneManagerType | Type of the SceneManager to get. |
| bool | isExactType | Whether to match the exact type. |
Returns
| Type | Description |
|---|---|
| IEnumerable<SceneManager> | The SceneManager instance found, or null if there was not a SceneManager with the selected type registered. |
FindManagers<T>(bool)
Gets a collection of SceneManager instances.
Declaration
public IEnumerable<T> FindManagers<T>(bool isExactType = false) where T : SceneManager
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isExactType | Whether to match the exact type. |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | The collection of SceneManager instances found, or null if there is no SceneManager registered with the specified type. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the SceneManager to get. |
InternalRemoveSceneManager(SceneManager, bool)
Unregisters a SceneManager.
Declaration
public bool InternalRemoveSceneManager(SceneManager sceneManager, bool destroy)
Parameters
| Type | Name | Description |
|---|---|---|
| SceneManager | sceneManager | The SceneManager to unregister. |
| bool | destroy | True if the SceneManager will be destroyed. |
Returns
| Type | Description |
|---|---|
| bool | True if the SceneManager has been successfully unregistered. |
Remarks
The unregistered SceneManager will be disposed of.
RemoveManager(SceneManager)
Unregisters a SceneManager.
Declaration
public bool RemoveManager(SceneManager sceneManager)
Parameters
| Type | Name | Description |
|---|---|---|
| SceneManager | sceneManager | The SceneManager to unregister. |
Returns
| Type | Description |
|---|---|
| bool | True if the SceneManager has been successfully unregistered. |
Remarks
The unregistered SceneManager will be disposed.
RemoveManager<T>()
Unregisters a SceneManager.
Declaration
public bool RemoveManager<T>() where T : SceneManager
Returns
| Type | Description |
|---|---|
| bool | True if the SceneManager has been successfully unregistered. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the SceneManager to unregister. |
Remarks
The unregistered SceneManager will be disposed of.
StartManagers()
Activate scene managers.
Declaration
public void StartManagers()
Remarks
This method initializes only new sceneManagers that are not initialized yet.
UpdateSceneManagers(TimeSpan)
Updates the registered UpdatableSceneManager instances.
Declaration
public void UpdateSceneManagers(TimeSpan gameTime)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | gameTime | The game time. |