Skip to main content

LensStudio:HierarchyUtils.js

Module

The LensStudio:HierarchyUtils.js module for Lens Studio plugins.

Interfaces

InterfaceDescription
CreateOptionsRepresents the options for creating a scene object.
SearchOptionsRepresents the options for searching.

Functions

FunctionDescription
createOrthoCameraOnObjectCreates an orthographic camera component on a scene object.
createPerspectiveCameraOnObjectCreates a perspective camera on the specified scene object.
findInAncestorsByNameFinds a scene object with the specified name in the ancestors of the given base scene object.
findInAncestorsByTypeFinds a scene object or an array of scene objects in the ancestors of a given base scene object by the specified component type.
findInDescendantsByNameFinds a scene object or an array of scene objects in the descendants of a base scene object by name.
findInDescendantsByTypeFinds a scene object or an array of scene objects within the descendants of a base scene object, based on the specified component type.
findInRootObjectsByNameFinds a scene object or an array of scene objects in the root objects of a scene by name.
findInRootObjectsByTypeFinds objects of a specific component type in the root of a scene.
findNearestCameraInAncestorsFinds the nearest camera in the ancestors of the given scene object.
findOrCreateCameraObjectFinds or creates a camera object of the specified type within the given scene.
findOrCreateChildWithNameFinds or creates a child scene object with the specified name under the given root object. It only searches the immediate children of the root object. If a child object with the specified name already exists, it is returned. Otherwise, a new scene object is created, added to the scene, and assigned the specified name.
findOrCreateOrthoCameraForObjectFinds or creates an orthographic camera for a given scene object.
getFirstCameraInSceneFinds the first camera in the scene.
getNearestOrFirstCameraFinds the nearest camera ancestor of a scene object, if one exists. if not, it returns the first camera in the scene.
getOrCreateCanvasRetrieves or creates a canvas component for a given camera object.
getOrCreateScreenRegionRetrieves or creates a ScreenRegionComponent for a given camera object and scene.