Class AREnvironmentProbeManager | AR Foundation | 2.2.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Class AREnvironmentProbeManager

    This class creates, maintains, and destroys environment probe game object components as the XREnvironmentProbeSubsystem provides updates from environment probes as they are detected in the environment.

    Inheritance
    Object
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>
    AREnvironmentProbeManager
    Inherited Members
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.trackables
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.SetTrackablesActive(Boolean)
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.sessionOrigin
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.gameObjectName
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.GetPrefab()
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.m_Trackables
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.m_PendingAdds
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.Awake()
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.Update()
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.OnTrackablesChanged(List<AREnvironmentProbe>, List<AREnvironmentProbe>, List<AREnvironmentProbe>)
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.OnCreateTrackable(AREnvironmentProbe)
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.OnAfterSetSessionRelativeData(AREnvironmentProbe, XREnvironmentProbe)
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.CreateTrackableImmediate(XREnvironmentProbe)
    ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>.DestroyPendingTrackable(TrackableId)
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.subsystem
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.descriptor
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.CreateSubsystem()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.CreateSubsystemIfNecessary()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.GetActiveSubsystemInstance()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnEnable()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnDisable()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnDestroy()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnBeforeStart()
    SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnAfterStart()
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    public sealed class AREnvironmentProbeManager : ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, AREnvironmentProbe>

    Properties

    automaticPlacement

    A property of the environment probe subsystem that, if enabled, automatically generates environment probes for the scene.

    Declaration
    public bool automaticPlacement { get; set; }
    Property Value
    Type Description
    Boolean

    true if automatic environment probe placement is enabled. Otherwise, false.

    debugPrefab

    Specifies a debug prefab that will be attached to all environment probes.

    Declaration
    public GameObject debugPrefab { get; set; }
    Property Value
    Type Description
    GameObject

    A debug prefab that will be attached to all environment probes.

    Remarks

    Setting a debug prefab allows for these environment probes to be more readily visualized but is not required for normal operation of this manager. This script will automatically create reflection probes for all environment probes reported by the XREnvironmentProbeSubsystem.

    environmentTextureFilterMode

    Specifies the texture filter mode to be used with the environment texture.

    Declaration
    public FilterMode environmentTextureFilterMode { get; set; }
    Property Value
    Type Description
    FilterMode

    The texture filter mode to be used with the environment texture.

    environmentTextureHDR

    Specifies whether the environment textures should be returned as HDR textures.

    Declaration
    public bool environmentTextureHDR { get; set; }
    Property Value
    Type Description
    Boolean

    true if the environment textures should be returned as HDR textures. Otherwise, false.

    gameObjectName

    Declaration
    protected override string gameObjectName { get; }
    Property Value
    Type Description
    String
    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, UnityEngine.XR.ARFoundation.AREnvironmentProbe>.gameObjectName

    Methods

    AddEnvironmentProbe(Pose, Vector3, Vector3)

    Creates a new environment probe at pose with scale and size if supported by the subsystem. Use .SubsystemDescriptor.supportsManualPlacement to determine support for this feature. If successful, a new GameObject with an AREnvironmentProbe will be created immediately; however, the provider may not report the environment probe as added until a future frame. Check the status of the probe by inspecting its property.

    Declaration
    public AREnvironmentProbe AddEnvironmentProbe(Pose pose, Vector3 scale, Vector3 size)
    Parameters
    Type Name Description
    Pose pose

    The position and rotation at which to create the new environment probe.

    Vector3 scale

    The scale of the new environment probe.

    Vector3 size

    The size (dimensions) of the new environment probe.

    Returns
    Type Description
    AREnvironmentProbe

    A new AREnvironmentProbe if successful, otherwise null.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this manager is not enabled

    InvalidOperationException

    Thrown if this manager has no subsystem.

    NotSupportedException

    Thrown if manual placement is not supported by this subsystem. Check for support with .SubsystemDescriptor.supportsManualPlacement

    GetEnvironmentProbe(TrackableId)

    Attempts to find the environment probe matching the trackable ID currently in the scene.

    Declaration
    public AREnvironmentProbe GetEnvironmentProbe(TrackableId trackableId)
    Parameters
    Type Name Description
    TrackableId trackableId

    The trackable ID of an environment probe for which to search.

    Returns
    Type Description
    AREnvironmentProbe

    Environment probe in the scene matching the trackableId or null if no matching environment probe is found.

    GetPrefab()

    Declaration
    protected override GameObject GetPrefab()
    Returns
    Type Description
    GameObject
    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, UnityEngine.XR.ARFoundation.AREnvironmentProbe>.GetPrefab()

    OnBeforeStart()

    Enables the environment probe functionality by registering listeners for the environment probe events, if the XREnvironmentProbeSubsystem exists, and enabling environment probes in the AR subsystem manager.

    Declaration
    protected override void OnBeforeStart()
    Overrides
    UnityEngine.XR.ARFoundation.SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnBeforeStart()

    OnCreateTrackable(AREnvironmentProbe)

    Declaration
    protected override void OnCreateTrackable(AREnvironmentProbe probe)
    Parameters
    Type Name Description
    AREnvironmentProbe probe
    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, UnityEngine.XR.ARFoundation.AREnvironmentProbe>.OnCreateTrackable(UnityEngine.XR.ARFoundation.AREnvironmentProbe)

    OnDestroy()

    Destroys any game objects created by this environment probe manager for each environment probe, and clears the mapping of environment probes.

    Declaration
    protected override void OnDestroy()
    Overrides
    UnityEngine.XR.ARFoundation.SubsystemLifecycleManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor>.OnDestroy()

    OnTrackablesChanged(List<AREnvironmentProbe>, List<AREnvironmentProbe>, List<AREnvironmentProbe>)

    Declaration
    protected override void OnTrackablesChanged(List<AREnvironmentProbe> added, List<AREnvironmentProbe> updated, List<AREnvironmentProbe> removed)
    Parameters
    Type Name Description
    List<AREnvironmentProbe> added
    List<AREnvironmentProbe> updated
    List<AREnvironmentProbe> removed
    Overrides
    UnityEngine.XR.ARFoundation.ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbe, UnityEngine.XR.ARFoundation.AREnvironmentProbe>.OnTrackablesChanged(System.Collections.Generic.List<UnityEngine.XR.ARFoundation.AREnvironmentProbe>, System.Collections.Generic.List<UnityEngine.XR.ARFoundation.AREnvironmentProbe>, System.Collections.Generic.List<UnityEngine.XR.ARFoundation.AREnvironmentProbe>)

    RemoveEnvironmentProbe(AREnvironmentProbe)

    Remove an existing environment probe. Support for this feature is provider-specific. Check for support with .SubsystemDescriptor.supportsRemovalOfManual and .SubsystemDescriptor.supportsRemovalOfAutomatic.

    Declaration
    public bool RemoveEnvironmentProbe(AREnvironmentProbe probe)
    Parameters
    Type Name Description
    AREnvironmentProbe probe

    The environment probe to remove

    Returns
    Type Description
    Boolean

    true if the environment probe was removed, otherwise false.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if this manager is not enabled.

    InvalidOperationException

    Thrown if is null.

    ArgumentNullException

    Thrown if probe is null.

    InvalidOperationException

    Thrown if the environment probe was manually placed, but removal of manually placed probes is not supported. You can check for this case with placementType and .SubsystemDescriptor.supportsRemovalOfManual

    InvalidOperationException

    Thrown if the environment probe was automatically placed, but removal of automatically placed probes is not supported. You can check for this case with placementType and .SubsystemDescriptor.supportsRemovalOfAutomatic

    Events

    environmentProbesChanged

    Invoked once per frame with lists of environment probes that have been added, updated, and removed since the last frame.

    Declaration
    public event Action<AREnvironmentProbesChangedEvent> environmentProbesChanged
    Event Type
    Type Description
    Action<AREnvironmentProbesChangedEvent>
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023