Closed kelsosharp closed 4 years ago
Thanks for filing this issue! So I've looked into a few of these types of issues in the past where most were caused by some random code that was hardcoding some paths (or otherwise searching in the root location instead of using the MixedRealityToolkitFiles abstraction).
This looks like another case - it looks like some of the newly added scene system stuff uses hardcoded paths in its serialized properties, instead of storing the guid of the asset instead (which is durable to file moves).
grep -ri Assets.MixedRealityToolkit --include=*unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHub.unity: Path: Assets/MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHub.unity: value: Assets/MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/UX/Tooltips/Scenes/TooltipExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Scenes/HandMenuExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Scenes/HandInteractionExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-04-TargetPositioning.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-03-Navigation.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-02-TargetSelection.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/UX/Slate/SlateExample.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/UX/PressableButton/Scenes/PressableButtonExample.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/StandardShader/Scenes/ClippingExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/UX/Slider/Scenes/SliderExample.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/UX/BoundingBox/Scenes/BoundingBoxExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-05-Visualizer.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Scenes/NearMenuExamples.unity MixedRealityToolkit.Examples/Experimental/ExamplesHub/Scenes/MRTKExamplesHubMainMenu.unity: value: Assets/MixedRealityToolkit.Examples/Demos/StandardShader/Scenes/MaterialGallery.unity
For all of the things grepped above, none of these should be referencing paths directly and should be using GUIDs instead.
I'm going to add some tooling that will detect hardcoded paths that get checked in the future so that we don't keep letting these sorts of errors into the code.
@Railboy can you fix the scene related hardcoded paths here?
For all of the things grepped above, none of these should be referencing paths directly and should be using GUIDs instead.
@wiwei Unfortunately it's not so straightforward. The SceneInfo struct holds a GUID, a name and a path. The GUID is for an editor-only asset (SceneAssetReference) which is stored as a unity object. The path is used to load the scene in the editor. The name is used to load the scene at runtime.
Related issues: #6060 Related PR: #6273
@Railboy thanks for clarifying - my analysis there was wrong and as you say, the issue at hand was a lot more complicated than simply doing a GUID/path switch (there are runtime vs edit time considerations that aren't obvious because of Unity SceneManager interactions)
Run the Scene Hub project
I moved all of the MRTK assets imported into the project to a new folder called MRTK, when trying to run the ExampleSceneHub in the Unity player, it cannot locate the files, its looking in the assets folder.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Should be able to locate examples based on the folder structure in the project.
Screenshots
If applicable, add screenshots to help explain your problem.
Your Setup (please complete the following information)
Target Platform (please complete the following information)
iOS