microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Importing Examples Hub scene with UPM generates SU namespace error #9799

Closed elbuhofantasma closed 3 years ago

elbuhofantasma commented 3 years ago

Describe the bug

When importing the MRTK Examples Hub scene with UPM into a project, the following warnings below are generated.

SUnamespace

To reproduce

Steps to reproduce the behavior:

  1. Create a new project in Unity 2020
  2. Import the MRTK UPM packages to the project via the Package Manager
  3. Under the Examples package, import the 'Experimental - Examples Hub' sample
  4. See error

Expected behavior

Importing example scenes do not generate errors in the Unity console.

Your setup (please complete the following information)

Target platform (please complete the following information)

MaxWang-MS commented 3 years ago

We are removing the following script from MRTK for now as it is not used by any scene/other script at the moment. The script is intended to properly clean up the mesh/GameObject generated in the Scene Understanding example scene before switching to another scene. We are planning to readd the script when we place it in a scene at a later date.

using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Experimental.SceneUnderstanding;
using Microsoft.MixedReality.Toolkit.SceneSystem;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
    public class SceneSystemUnloadingCheck : MonoBehaviour
    {
        public DemoSceneUnderstandingController SUController;
        private bool isCleared = false;

        void Start()
        {
            IMixedRealitySceneSystem sceneSystem = MixedRealityToolkit.Instance.GetService<IMixedRealitySceneSystem>();
            sceneSystem.OnWillUnloadContent += HandleSceneOperation;
        }

        private void HandleSceneOperation(IEnumerable<string> obj)
        {
            if (isCleared == false)
            {
                SUController.ClearScene();
                isCleared = true;
            }
        }
    }
}