docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ViewContext

    Data container containing content of a view

    Inheritance
    object
    ViewContext
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Rendering.LookDev
    Assembly: Unity.RenderPipelines.Core.Editor.dll
    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
    bool

    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
    bool

    viewedInstanceInPreview

    The currently displayed instance of viewedObjectReference. It will be instantiated when pushing changes to renderer. See SaveContextChangeAndApply(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
    Object environmentOrCubemapAsset

    The new Environment to use. Or the UnityEngine.Cubemap to use to build a new one. Other types will raise an ArgumentException.

    UpdateViewedObject(GameObject)

    Update the object reference used for instantiation.

    Declaration
    public void UpdateViewedObject(GameObject viewedObject)
    Parameters
    Type Name Description
    GameObject viewedObject

    The new reference.

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)