Skip to content

Commit 8e3bc66

Browse files
author
David Kline
authored
Merge pull request #8753 from davidkline-ms/moveSceneSysScenes
Fix inaccessible scene system resources
2 parents cb89e4b + 908cc71 commit 8e3bc66

17 files changed

+134
-17
lines changed

Assets/MRTK/Core/Inspectors/Profiles/MixedRealitySceneSystemProfileInspector.cs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ public class MixedRealitySceneSystemProfileInspector : BaseMixedRealityToolkitCo
1919
const float DragAreaOffset = 10;
2020
const float LightingSceneTypesLabelWidth = 45;
2121

22-
private static string managerSceneContent =
23-
"The Manager scene is loaded first and remains loaded for the duration of the app. Only one Manager scene is ever loaded, and no scene operation will ever unload it.";
22+
private const string defaultSceneContent =
23+
"Default scene system resources were not found.\nIf using custom manager and lighting scenes, this message can be ignored.\nIf not, please see the documentation for more information";
2424

25-
private static string lightingSceneContent =
26-
"The Lighting scene controls lighting settings such as ambient light, skybox and sun direction. A Lighting scene's content is restricted based on the types defined in your editor settings. A default lighting scene is loaded on initialization. Only one lighting scene will ever be loaded at a time.";
25+
private const string managerSceneContent =
26+
"The manager scene is loaded first and remains loaded for the duration of the app. Only one manager scene is ever loaded, and no scene operation will ever unload it.";
2727

28-
private static string contentSceneContent =
28+
private const string lightingSceneContent =
29+
"The lighting scene controls lighting settings such as ambient light, skybox and sun direction. A lighting scene's content is restricted based on the types defined in your editor settings. A default lighting scene is loaded on initialization. Only one lighting scene will ever be loaded at a time.";
30+
31+
private const string contentSceneContent =
2932
"Content scenes are everything else. You can load and unload any number of content scenes in any combination, and their content is unrestricted.";
3033

3134
private static bool showEditorProperties = true;
@@ -98,6 +101,11 @@ public override void OnInspectorGUI()
98101

99102
MixedRealitySceneSystemProfile profile = (MixedRealitySceneSystemProfile)target;
100103

104+
if (!FindDefaultResources())
105+
{
106+
EditorGUILayout.HelpBox(defaultSceneContent, MessageType.Info);
107+
}
108+
101109
RenderFoldout(ref showEditorProperties, "Editor Settings", () =>
102110
{
103111
using (new EditorGUI.IndentLevelScope())
@@ -311,5 +319,24 @@ private void DrawContentSceneElement(Rect rect, int index, bool isActive, bool i
311319
{
312320
SceneInfoDrawer.DrawProperty(rect, contentScenes.GetArrayElementAtIndex(index), GUIContent.none, isActive, isFocused);
313321
}
322+
323+
private const string defaultManagerAssetGuid = "ae7bb08d297fb69408695d8de0962524";
324+
private Object defaultManagerAsset = null;
325+
private const string defaultLightingAssetGuid = "7e54e36c44f826c438c95da79f8de638";
326+
private Object defaultLightingAsset = null;
327+
328+
private bool FindDefaultResources()
329+
{
330+
if ((defaultManagerAsset != null) &&
331+
(defaultLightingAsset != null))
332+
{
333+
return true;
334+
}
335+
336+
defaultManagerAsset = AssetDatabase.LoadAssetAtPath<SceneAsset>(AssetDatabase.GUIDToAssetPath(defaultManagerAssetGuid));
337+
defaultLightingAsset = AssetDatabase.LoadAssetAtPath<SceneAsset>(AssetDatabase.GUIDToAssetPath(defaultLightingAssetGuid));
338+
339+
return ((defaultManagerAsset != null) && (defaultLightingAsset != null));
340+
}
314341
}
315342
}

Assets/MRTK/Examples/Experimental/ExamplesHub/Profiles/MRTKExamplesHubSceneSystemProfile.asset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MonoBehaviour:
1616
useManagerScene: 0
1717
managerScene:
1818
Name: DefaultManagerScene
19-
Path: Assets/MRTK/SDK/StandardAssets/Scenes/DefaultManagerScene.unity
19+
Path: Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity
2020
Included: 0
2121
BuildIndex: -1
2222
Tag: Untagged
@@ -25,7 +25,7 @@ MonoBehaviour:
2525
defaultLightingSceneIndex: 0
2626
lightingScenes:
2727
- Name: DefaultLightingScene
28-
Path: Assets/MRTK/SDK/StandardAssets/Scenes/DefaultLightingScene.unity
28+
Path: Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity
2929
Included: 0
3030
BuildIndex: -1
3131
Tag: Untagged

Assets/MRTK/SDK/Profiles/DefaultMixedRealitySceneSystemProfile.asset

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MonoBehaviour:
1616
useManagerScene: 1
1717
managerScene:
1818
Name: DefaultManagerScene
19-
Path: Assets/MRTK/SDK/StandardAssets/Scenes/DefaultManagerScene.unity
19+
Path: Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity
2020
Included: 0
2121
BuildIndex: -1
2222
Tag: Untagged
@@ -25,7 +25,7 @@ MonoBehaviour:
2525
defaultLightingSceneIndex: 0
2626
lightingScenes:
2727
- Name: DefaultLightingScene
28-
Path: Assets/MRTK/SDK/StandardAssets/Scenes/DefaultLightingScene.unity
28+
Path: Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity
2929
Included: 0
3030
BuildIndex: -1
3131
Tag: Untagged

Assets/MRTK/SDK/StandardAssets/Scenes.meta renamed to Assets/MRTK/SceneSystemResources.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MRTK/SDK/StandardAssets/Scenes/DefaultLightingScene.unity renamed to Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity

File renamed without changes.

Assets/MRTK/SDK/StandardAssets/Scenes/DefaultLightingScene.unity.meta renamed to Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity.meta

File renamed without changes.

Assets/MRTK/SDK/StandardAssets/Scenes/DefaultManagerScene.unity renamed to Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity

File renamed without changes.

Assets/MRTK/SDK/StandardAssets/Scenes/DefaultManagerScene.unity.meta renamed to Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity.meta

File renamed without changes.

Assets/MRTK/packagetemplate.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"Providers*",
3232
"SDK*",
3333
"Services*",
34-
"package.json.meta"
35-
]
34+
"package.json.meta",
35+
"Samples~"
36+
],
37+
%samples%
3638
}
7.14 KB
Loading

0 commit comments

Comments
 (0)