Skip to content

PreviewLightingSetup

ClassAssetInventoryAssetInventory.Editor
public static class PreviewLightingSetup

Centralized lighting creation and positioning for all preview types. Consolidates lighting logic from PreviewManager, CustomPreviewStage, and PreviewSceneSetup.

public static Light CreateMainLight(Scene scene, bool addToScene = true)

Create main preview light

Parameters

NameType
sceneUnityEngine.SceneManagement.Scene
addToSceneSystem.Boolean

Returns

UnityEngine.Light

public static Light CreateSecondaryLight(Scene scene, bool addToScene = true)

Create secondary rim light

Parameters

NameType
sceneUnityEngine.SceneManagement.Scene
addToSceneSystem.Boolean

Returns

UnityEngine.Light

public static Color GetLightColor()

Get main light color from configuration

Returns

UnityEngine.Color

public static Color GetSecondaryLightColor()

Get secondary light color from configuration

Returns

UnityEngine.Color

public static void SetLightIntensity(Light light, bool isSecondary)

Set light intensity based on render pipeline

Parameters

NameType
lightUnityEngine.Light
isSecondarySystem.Boolean

PositionLight(Light, Camera, GameObject, PrefabType, bool)

Section titled “PositionLight(Light, Camera, GameObject, PrefabType, bool)”
public static void PositionLight(Light light, Camera camera, GameObject target, CustomPrefabPreviewGenerator.PrefabType prefabType = PrefabType.Model, bool isSecondaryLight = false)

Position light relative to camera and target

Parameters

NameType
lightUnityEngine.Light
cameraUnityEngine.Camera
targetUnityEngine.GameObject
prefabTypeAssetInventory.CustomPrefabPreviewGenerator.PrefabType
isSecondaryLightSystem.Boolean

PositionLightForScene(Light, Camera, Bounds)

Section titled “PositionLightForScene(Light, Camera, Bounds)”
public static void PositionLightForScene(Light light, Camera camera, Bounds bounds)

Position light for scene rendering

Parameters

NameType
lightUnityEngine.Light
cameraUnityEngine.Camera
boundsUnityEngine.Bounds