docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UnityXRDisplay

    static container for XRDisplay-related scripting functionality.

    Inheritance
    object
    UnityXRDisplay
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.API
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public static class UnityXRDisplay

    Fields

    kUnityXRRenderTextureIdDontCare

    Unity will allocate the texture if needed. #kUnityXRRenderTextureIdDontCare can be set on UnityXRRenderTextureDesc.nativeColorTexPtr or UnityXRRenderTextureDesc.nativeDepthTexPtr.

    Declaration
    public const uint kUnityXRRenderTextureIdDontCare = 0
    Field Value
    Type Description
    uint

    Methods

    CreateTexture(UnityXRRenderTextureDesc, out uint)

    Create a UnityXRRenderTextureId given a UnityXRRenderTextureDesc.

    Declaration
    public static extern bool CreateTexture(UnityXRRenderTextureDesc desc, out uint id)
    Parameters
    Type Name Description
    UnityXRRenderTextureDesc desc

    Descriptor of the texture to be created.

    uint id

    Returned Texture ID representing a unique instance of a texture.

    Returns
    Type Description
    bool

    true Successfully initialized false Error

    DestroyTexture(uint)

    Destroy a texture given a UnityXRRenderTextureId.

    Declaration
    public static extern bool DestroyTexture(uint textureId)
    Parameters
    Type Name Description
    uint textureId

    Texture ID represents the instance of a texture to be destroyed.

    Returns
    Type Description
    bool

    true Successfully destroyed. false Error

    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)