Class AREnvironmentProbeManager
This class creates, maintains, and destroys environment probe GameObject components as the
XREnvironmentProbeSubsystem
provides updates from environment probes as they are detected in the
environment.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: Unity.XR.ARFoundation.dll
Syntax
[DisallowMultipleComponent]
[DefaultExecutionOrder(-2147483647)]
public sealed class AREnvironmentProbeManager : ARTrackableManager<XREnvironmentProbeSubsystem, XREnvironmentProbeSubsystemDescriptor, XREnvironmentProbeSubsystem.Provider, XREnvironmentProbe, AREnvironmentProbe>, ITrackablesChanged<AREnvironmentProbe>
Properties
automaticPlacementEnabled
true if automatic placement is enabled on the subsystem.
Declaration
public bool automaticPlacementEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
automaticPlacementRequested
If enabled, requests automatic generation of environment probes for the scene.
Declaration
public bool automaticPlacementRequested { get; set; }
Property Value
Type | Description |
---|---|
bool | true if automatic environment probe placement is requested. 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 | The debug prefab. |
Remarks
Setting a debug prefab allows for 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. |
environmentTextureHDREnabled
Queries whether environment textures are provided with high dynamic range (HDR).
Declaration
public bool environmentTextureHDREnabled { get; }
Property Value
Type | Description |
---|---|
bool |
environmentTextureHDRRequested
Get or set whether high dynamic range environment textures are requested.
Declaration
public bool environmentTextureHDRRequested { get; set; }
Property Value
Type | Description |
---|---|
bool | true if high dynamic range environment textures are requested. Otherwise, false. |
gameObjectName
The name of the GameObject
for each instantiated AREnvironmentProbe.
Declaration
protected override string gameObjectName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
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 to search for. |
Returns
Type | Description |
---|---|
AREnvironmentProbe | Environment probe in the scene matching the |
GetPrefab()
Gets the prefab that should be instantiated for each AREnvironmentProbe. May be null
.
Declaration
protected override GameObject GetPrefab()
Returns
Type | Description |
---|---|
GameObject | The prefab that should be instantiated for each AREnvironmentProbe. |
Overrides
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
OnCreateTrackable(AREnvironmentProbe)
Invoked when an AREnvironmentProbe is created.
Declaration
protected override void OnCreateTrackable(AREnvironmentProbe probe)
Parameters
Type | Name | Description |
---|---|---|
AREnvironmentProbe | probe | The AREnvironmentProbe that was just created. |
Overrides
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
OnTrackablesChanged(List<AREnvironmentProbe>, List<AREnvironmentProbe>, List<AREnvironmentProbe>)
Invoked when the base class detects trackable changes.
Declaration
[Obsolete("OnTrackablesChanged() has been deprecated in AR Foundation version 6.0.", false)]
protected override void OnTrackablesChanged(List<AREnvironmentProbe> added, List<AREnvironmentProbe> updated, List<AREnvironmentProbe> removed)
Parameters
Type | Name | Description |
---|---|---|
List<AREnvironmentProbe> | added | The list of added AREnvironmentProbe. |
List<AREnvironmentProbe> | updated | The list of updated AREnvironmentProbe. |
List<AREnvironmentProbe> | removed | The list of removed AREnvironmentProbe. |
Overrides
Events
environmentProbesChanged
Invoked once per frame with lists of environment probes that have been added, updated, and removed since the last frame.
Declaration
[Obsolete("environmentProbesChanged has been deprecated in AR Foundation version 6.0. Use trackablesChanged instead.", false)]
public event Action<AREnvironmentProbesChangedEvent> environmentProbesChanged
Event Type
Type | Description |
---|---|
Action<AREnvironmentProbesChangedEvent> |