Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How Call OnDestroy @ AREnvironmentProbeManager

Discussion in 'AR' started by Tarrag, Sep 24, 2019.

  1. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    215
    Hi,
    I'd want to give the user the option to switch off AR Env Probes and at OnDisable destroy any trackables/probes created by AREnvironmentProbeManager. At 3.0 prev.2 the probes remain after disabling AREnvProbeMgr.

    OnDestroy at AREnvironmentProbeManager.cs seems to do just this:

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

    How can I call this function? It's protected in package.

    Thanks a bunch for your help

    Sergio
     
    Last edited: Sep 24, 2019
  2. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    215
    In case it helps anyone, I ended up subscribing to AREnvironmentProbeManagerScript environmentProbesChanged , creating a list of probes and removing using AREnvironmentProbeManagerScript GetEnvironmentProbe