Editor.Assets.Scene
ClassThe entity which will be converted into the Lens scene during project export.
The entity which will be converted into the Lens scene during project export. This scene will contain and own all objects and components in the Lens. This entity can be accessed via the current project’s model.project.scene.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
// Scene exposes: mainCamera, rootSceneObjects, captureTarget, liveTarget
const mainCamera = scene.mainCamera;
const captureTarget = scene.captureTarget;
const liveTarget = scene.liveTarget;
// Create a new scene object at the scene root
const obj = scene.createSceneObject('MyObject');
console.log(`Created "${obj.name}"; scene has ${scene.rootSceneObjects.length} root(s), mainCamera=${Editor.isNull(mainCamera) ? 'none' : mainCamera.name}, targets=[${captureTarget.name}, ${liveTarget.name}]`);
Extends
Properties
cacheFile
readonlycacheFile:Path
Path to the cached asset file.
Inherited from
captureTarget
captureTarget:
RenderTarget
Render target for capture output.
fileMeta
readonlyfileMeta:AssetImportMetadata
Import metadata for the asset.
Inherited from
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
layers
readonlylayers:Layers
This list of layers that exists within this scene.
liveOverlayTarget
liveOverlayTarget:
RenderTarget
Render target for live overlay rendering.
liveTarget
liveTarget:
RenderTarget
Render target for live preview output.
mainCamera
readonlymainCamera:Camera
The camera that renders renderOutput.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
name
readonlyname:string
The name of the asset.
Inherited from
physicsRootWorldSettings
physicsRootWorldSettings:
WorldSettingsBase
Physics world settings asset used by the scene's root physics world, or null if none is assigned.
rootSceneObjects
readonlyrootSceneObjects:SceneObject[]
A list of scene objects which is a direct child of this entity.
Inherited from
sceneObjects
readonlysceneObjects:SceneObject[]
A list of scene objects which is a child of this entity.
Inherited from
type
readonlytype:string
The entity's type.
Inherited from
Methods
addSceneObject()
addSceneObject(
parent):SceneObject
Adds a scene object to the entity.
Parameters
| Parameter | Type |
|---|---|
parent | SceneObject |
Returns
Inherited from
createSceneObject()
createSceneObject(
name):SceneObject
Creates a scene object to the entity.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Inherited from
findComponents()
findComponents(
entityType):Component[]
Find components on the entity.
Parameters
| Parameter | Type |
|---|---|
entityType | string |
Returns
Inherited from
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
Inherited from
ObjectOwner.getDirectlyReferencedEntities
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
getRootObjectIndex()
getRootObjectIndex(
object):number
Get the index of object within the list of all the root objects.
Parameters
| Parameter | Type |
|---|---|
object | SceneObject |
Returns
number
Inherited from
ObjectOwner.getRootObjectIndex
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
instantiatePrefab()
instantiatePrefab(
prefab,parent):SceneObject
Instantiate a prefab as a child of parent under this entity.
Parameters
| Parameter | Type |
|---|---|
prefab | ObjectPrefab |
parent | SceneObject |
Returns
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
reparentSceneObject()
reparentSceneObject(
object,newParent,position?):void
Reparent the scene object to another scene object. You can use this to reparent objects to the root (i.e. pass in null).
Parameters
| Parameter | Type |
|---|---|
object | SceneObject |
newParent | SceneObject |
position? | number |
Returns
void