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

Name Type Description
scene UnityEngine.SceneManagement.Scene
addToScene System.Boolean

Returns

UnityEngine.Light — No return description is available.

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

Create secondary rim light

Parameters

Name Type Description
scene UnityEngine.SceneManagement.Scene
addToScene System.Boolean

Returns

UnityEngine.Light — No return description is available.

public static Color GetLightColor()

Get main light color from configuration

Returns

UnityEngine.Color — No return description is available.

public static Color GetSecondaryLightColor()

Get secondary light color from configuration

Returns

UnityEngine.Color — No return description is available.

public static void SetLightIntensity(Light light, bool isSecondary)

Set light intensity based on render pipeline

Parameters

Name Type Description
light UnityEngine.Light
isSecondary System.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

Name Type Description
light UnityEngine.Light
camera UnityEngine.Camera
target UnityEngine.GameObject
prefabType AssetInventory.CustomPrefabPreviewGenerator.PrefabType
isSecondaryLight System.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

Name Type Description
light UnityEngine.Light
camera UnityEngine.Camera
bounds UnityEngine.Bounds