MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

MixedRealityToolkitFacadeHandler Destroy all children creating MRTK instance

Open provencher opened this issue 7 years ago • 2 comments

Describe the bug

The MixedRealityToolkitFacadeHandler has a function called DestroyAllChildren that gets called when the playmode state changes, among other times, which calls MixedRealityToolkit.Instance to grab it's children and destroy them.

However, when this happens, if there is not already an MRTK instance in the scene, it will create one and then destroy it. This is is very highly undesirable.

To reproduce

Open a scene without the mrtk, but with the mrtk in the project. Hit play, and then stop playmode. DestroyAllChildren will be called and this behavior will be hit.

Expected behavior

DestroyAllChildren is not executed if no MRTK instance exists in the scene, and cleanup scripts should not add garbage to the scene.

Screenshots

Your Setup (please complete the following information)

  • Unity Version 2018.3.8f1
  • MRTK Version v2.0 latest dev

Target Platform (please complete the following information)

  • HoloLens 2

Additional context

provencher avatar May 01 '19 21:05 provencher

This is an excellent bug description, thank you!

julenka avatar May 02 '19 05:05 julenka

Yeah @provencher your description is why this was literally fixed in 15 minutes, thank you.

Railboy avatar May 02 '19 16:05 Railboy