class
SceneInstance
Contains information about an instantiated scene.
Public
Constructors
SceneInstance
Methods
~SceneInstance
Initialize
Initializes all the internal data of this object.
Must be called right after construction for new objects, or after deserialization for deserialized objects. If requested, render proxy is created and queued for initialization on the render thread.
Destroy
Frees all the data held by this object.
If the object has a render proxy, the internal reference to the render proxy will be released, but the proxy will not be destroyed unless this was the last reference. If render proxy destruction does happen, it is not immediate, but rather queued for destruction on the render thread.
GetName
Name of the scene.
GetRoot
Root object of the scene.
IsActive
Checks is the scene currently active.
IF inactive the scene properties aside from the name are undefined.
GetPhysicsScene
Representation of the scene used by the physics sub-system.
Contains all the objects that can be physically interacted with. Exact implementation depends on the physics plugin used.
GetRendererScene
Representation of the scene used by the renderer.
Contains all the objects that need to be rendered. Exact implementation depends on the renderer plugin used.
GetAnimationScene
Returns the object responsible for updating animations in this scene.
GetParticleScene
Returns the object responsible for updating particles in this scene.
GetTime
Returns an object that manages time associated with this scene.
GetAssociatedResourceId
Returns the ID of the resource that the scene instance is associated with (e.g. resource the scene was loaded from.).
GetAllCameras
Returns all cameras in the scene.
GetMainCamera
Returns the camera in the scene marked as main.
Main camera controls the final render surface that is displayed to the user. If there are multiple main cameras, the first one found returned.
GetEditorSceneInstance
Editor scene instance, if running from within the editor.
Clear
Removes all scene objects from the scene, except for persistent objects.
If is true, removes even the persistent objects.
CreateSceneObject
Creates a new scene object in the scene instance.
- name
- Name of the scene object.
- flags
- Optional flags that control object behavior. See SceneObjectFlags.
staticCreate
Creates a new empty scene instance.
staticCreate
Creates a new scene instance with an existing hierarchy.
staticCreate
Creates a new scene instance with an existing hierarchy and associated resource ID.
Internal
Methods
GetECSRegistry
GetGameObjectCollection
Returns the game object collection storing all the scene's game objects.
SetAssociatedResourceId
Sets the ID of the resource that the scene instance is associated with (e.g. resource the scene was loaded from.).
SetRoot
Changes the root scene object.
Any persistent objects will remain in the scene, now parented to the new root. All non-persistent objects in the old root are destroyed.
FixedUpdate
Called every frame before Update().
Calls FixedUpdate() methods on all active components and advances physics.
RegisterCamera
Notifies the scene instance that a new camera was created.
UnregisterCamera
Notifies the scene instance that a camera was removed.
NotifyMainCameraStateChanged
Notifies the scene instance that a camera either became the main camera, or has stopped being main camera.
SetMainCameraRenderTarget
Sets the render target that the main camera in the scene (if any) will render its view to.
This generally means the main game window when running standalone, or the Game viewport when running in editor.
SetEditorSceneInstance
Private
Methods
CreateRenderProxy
Creates an object that contains render thread specific data and methods for this object.
Can be null if such object is not required.
OnMainRenderTargetResized
Callback that is triggered when the main render target size is changed.
Fields
mName
mRoot
mAssociatedResourceId
ID of the resource the scene was loaded from, if any.