Skip to main content

LensStudio:HierarchyUtils.js.getOrCreateScreenRegion

Function

Retrieves or creates a ScreenRegionComponent for a given camera object and scene.

getOrCreateScreenRegion(cameraObject, scene): ScreenRegionComponent

Retrieves or creates a ScreenRegionComponent for a given camera object and scene.

Parameters

ParameterTypeDescription
cameraObjectSceneObjectThe camera object to search for a ScreenRegionComponent.
sceneSceneThe scene in which to create the ScreenRegionComponent if it doesn't exist.

Returns

ScreenRegionComponent

The ScreenRegionComponent associated with the camera object, or a newly created one.