Skip to content

Commit f865921

Browse files
author
davidkline-ms
committed
move scene system default resources, add check in inspector, update profiles
1 parent 6526123 commit f865921

File tree

4 files changed

+41
-11
lines changed

4 files changed

+41
-11
lines changed

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

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

22+
private static 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";
24+
2225
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.";
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.";
2427

2528
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.";
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.";
2730

2831
private static 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.";
@@ -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,27 @@ 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 bool FindDefaultResources()
324+
{
325+
string[] defaultResourceGuids =
326+
{
327+
"ae7bb08d297fb69408695d8de0962524", // DefaultManagerScene
328+
"7e54e36c44f826c438c95da79f8de638" // DefaultLightingScene
329+
};
330+
331+
bool findSucceeded = true;
332+
foreach (string s in defaultResourceGuids)
333+
{
334+
string asset = AssetDatabase.GUIDToAssetPath(s) as string;
335+
if (string.IsNullOrWhiteSpace(asset))
336+
{
337+
findSucceeded = false;
338+
break;
339+
}
340+
}
341+
342+
return findSucceeded;
343+
}
314344
}
315345
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ MonoBehaviour:
1616
useManagerScene: 0
1717
managerScene:
1818
Name: DefaultManagerScene
19-
Path: Assets/MRTK/Services/SceneSystem/Scenes/DefaultManagerScene.unity
19+
Path: Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity
2020
Included: 1
21-
BuildIndex: 0
21+
BuildIndex: -1
2222
Tag: Untagged
2323
Asset: {fileID: 102900000, guid: ae7bb08d297fb69408695d8de0962524, type: 3}
2424
useLightingScene: 0
2525
defaultLightingSceneIndex: 0
2626
lightingScenes:
2727
- Name: DefaultLightingScene
28-
Path: Assets/MRTK/Services/SceneSystem/Scenes/DefaultLightingScene.unity
28+
Path: Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity
2929
Included: 1
30-
BuildIndex: 15
30+
BuildIndex: -1
3131
Tag: Untagged
3232
Asset: {fileID: 102900000, guid: 7e54e36c44f826c438c95da79f8de638, type: 3}
3333
contentScenes:

Assets/MRTK/SDK/Profiles/DefaultMixedRealitySceneSystemProfile.asset

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ MonoBehaviour:
1616
useManagerScene: 1
1717
managerScene:
1818
Name: DefaultManagerScene
19-
Path: Assets/MRTK/Services/SceneSystem/Scenes/DefaultManagerScene.unity
19+
Path: Assets/MRTK/SceneSystemResources/DefaultManagerScene.unity
2020
Included: 1
21-
BuildIndex: 0
21+
BuildIndex: -1
2222
Tag: Untagged
2323
Asset: {fileID: 102900000, guid: ae7bb08d297fb69408695d8de0962524, type: 3}
2424
useLightingScene: 1
2525
defaultLightingSceneIndex: 0
2626
lightingScenes:
2727
- Name: DefaultLightingScene
28-
Path: Assets/MRTK/Services/SceneSystem/Scenes/DefaultLightingScene.unity
28+
Path: Assets/MRTK/SceneSystemResources/DefaultLightingScene.unity
2929
Included: 1
30-
BuildIndex: 15
30+
BuildIndex: -1
3131
Tag: Untagged
3232
Asset: {fileID: 102900000, guid: 7e54e36c44f826c438c95da79f8de638, type: 3}
3333
contentScenes: []

Assets/MRTK/Services/SceneSystem/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.

0 commit comments

Comments
 (0)