Class ViewContext
Data container containing content of a view
Namespace: UnityEditor.Rendering.LookDev
Syntax
[Serializable]
public class ViewContext
Properties
camera
The position and rotation of the camera
Declaration
public CameraState camera { get; }
Property Value
Type | Description |
---|---|
CameraState |
debug
The currently viewed debugState
Declaration
public DebugContext debug { get; }
Property Value
Type | Description |
---|---|
DebugContext |
environment
The currently used Environment
Declaration
public Environment environment { get; }
Property Value
Type | Description |
---|---|
Environment |
hasEnvironment
Check if an Environment is registered for this view. The result will be accurate even if the Environment have not been reloaded yet.
Declaration
public bool hasEnvironment { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasViewedObject
Check if an Environment is registered for this view. The result will be accurate even if the object have not been reloaded yet.
Declaration
public bool hasViewedObject { get; }
Property Value
Type | Description |
---|---|
Boolean |
viewedInstanceInPreview
The currently displayed instance of viewedObjectReference. It will be instantiated when pushing changes to renderer. See UnityEditor.Rendering.LookDev.LookDev.SaveContextChangeAndApply(UnityEditor.Rendering.LookDev.ViewIndex)
Declaration
public GameObject viewedInstanceInPreview { get; }
Property Value
Type | Description |
---|---|
GameObject |
viewedObjectReference
Reference to the object given for instantiation.
Declaration
public GameObject viewedObjectReference { get; }
Property Value
Type | Description |
---|---|
GameObject |
Methods
ResetCameraState()
Reset the camera state to default values
Declaration
public void ResetCameraState()
UpdateEnvironment(Object)
Update the environment used.
Declaration
public void UpdateEnvironment(Object environmentOrCubemapAsset)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Object | environmentOrCubemapAsset | The new Environment to use.
Or the |
UpdateViewedObject(GameObject)
Update the object reference used for instantiation.
Declaration
public void UpdateViewedObject(GameObject viewedObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | viewedObject | The new reference. |