Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Resolved Adding Environment Probe manually

Discussion in 'AR' started by Volkerku, Nov 19, 2020.

  1. Volkerku


    Nov 23, 2016
    Does someone has code how to do that?
    The EnvironmentProbeManager tells me to:

    Code (CSharp):
    1. /// <summary>
    2.         /// Creates a new environment probe at <paramref name="pose"/> with <paramref name="scale"/> and <paramref name="size"/>
    3.         /// if supported by the subsystem. Use the <see cref="SubsystemLifecycleManager{TSubsystem, TSubsystemDescriptor}.descriptor"/>'s
    4.         /// `supportsManualPlacement` property to determine support for this feature. If successful, a new
    5.         /// <c>GameObject</c> with an <see cref="AREnvironmentProbe"/> will be created
    6.         /// immediately; however, the provider may not report the environment probe as added until a future frame. Check the
    7.         /// status of the probe by inspecting its
    8.         /// <see cref="ARTrackable{TSessionRelativeData,TTrackable}.pending"/> property.
    9.         /// </summary>
    10.         /// <param name="pose">The position and rotation at which to create the new environment probe.</param>
    11.         /// <param name="scale">The scale of the new environment probe.</param>
    12.         /// <param name="size">The size (dimensions) of the new environment probe.</param>
    13.         /// <returns>A new <see cref="AREnvironmentProbe"/> if successful, otherwise <c>null</c>.</returns>
    14.         /// <exception cref="System.InvalidOperationException">Thrown if this manager is not enabled</exception>
    15.         /// <exception cref="System.InvalidOperationException">Thrown if this manager has no subsystem.</exception>
    16.         /// <exception cref="System.NotSupportedException">Thrown if manual placement is not supported by this subsystem.
    17.         /// Check for support on the <see cref="SubsystemLifecycleManager{TSubsystem, TSubsystemDescriptor}.descriptor"/>'s
    18.         ///     `supportsManualPlacement` property.</exception>
    19.         [Obsolete("Add an environment probe using AddComponent<" + nameof(AREnvironmentProbe) + ">(). (2020-10-06)")]
    But I have nio idea how to dio this.
    There is the comment: [Obsolete("Add an environment probe using AddComponent<" + nameof(AREnvironmentProbe) + ">(). (2020-10-06)")]

    Does this mean I need to use the AREnvironmentProbe component?
    How do I check if the subsystem supports manual placement?
  2. mfuad


    Unity Technologies

    Jun 12, 2018