SceneInstance Class
Namespace: Stride.EngineAssembly: Stride.Engine.dll
Manage a collection of entities within a RootScene.
public sealed class SceneInstance : EntityManager, IDisposable, IComponent, IReferencable, ICollectorHolder, IReadOnlySet<Entity>, IReadOnlyCollection<Entity>, IEnumerable<Entity>, IEnumerable
| Name | Description | |
|---|---|---|
| Constructors | ||
| SceneInstance(IServiceRegistry) | Initializes a new instance of the EntityManager class. |
|
| SceneInstance(IServiceRegistry, Scene, ExecutionMode) | Initializes a new instance of the SceneInstance class. |
|
| Fields | ||
| Current | A property key to get the current scene from the |
|
| CurrentRenderSystem | A property key to get the current render system from the |
|
| CurrentVisibilityGroup | A property key to get the current visibility group from the |
|
| Properties | ||
| RootScene | Gets the scene. |
|
| VisibilityGroups | ||
| Methods | ||
| Destroy() | ||
| GetCurrent(RenderContext) | Gets the current scene valid only from a rendering context. May be null. |
|
| Events | ||
| RootSceneChanged | Occurs when the scene changed from a scene child component. |
|
Constructors
SceneInstance(IServiceRegistry)
Initializes a new instance of the EntityManager class.
public SceneInstance(IServiceRegistry registry)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceRegistry | registry | The registry. |
SceneInstance(IServiceRegistry, Scene, ExecutionMode)
Initializes a new instance of the SceneInstance class.
public SceneInstance(IServiceRegistry services, Scene rootScene, ExecutionMode executionMode = ExecutionMode.Runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceRegistry | services | The services. |
| Scene | rootScene | The scene entity root. |
| ExecutionMode | executionMode | The mode that determines which processors are executed. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | services or rootScene |
Fields
Current
A property key to get the current scene from the
public static readonly PropertyKey<SceneInstance> Current
Field Value
| Type | Description |
|---|---|
| PropertyKey<SceneInstance> |
CurrentRenderSystem
A property key to get the current render system from the
public static readonly PropertyKey<RenderSystem> CurrentRenderSystem
Field Value
| Type | Description |
|---|---|
| PropertyKey<RenderSystem> |
CurrentVisibilityGroup
A property key to get the current visibility group from the
public static readonly PropertyKey<VisibilityGroup> CurrentVisibilityGroup
Field Value
| Type | Description |
|---|---|
| PropertyKey<VisibilityGroup> |
Properties
RootScene
Gets the scene.
public Scene RootScene { get; set; }
Property Value
| Type | Description |
|---|---|
| Scene | The scene. |
VisibilityGroups
public TrackingCollection<VisibilityGroup> VisibilityGroups { get; }
Property Value
| Type | Description |
|---|---|
| TrackingCollection<VisibilityGroup> |
Methods
Destroy()
protected override void Destroy()
Overrides
GetCurrent(RenderContext)
Gets the current scene valid only from a rendering context. May be null.
public static SceneInstance GetCurrent(RenderContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderContext | context | The context. |
Returns
| Type | Description |
|---|---|
| SceneInstance | Stride.Engine.SceneInstance. |
Events
RootSceneChanged
Occurs when the scene changed from a scene child component.
public event EventHandler<EventArgs> RootSceneChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<System.EventArgs> |