Skip to content

Commit 1ee3cb7

Browse files
committed
Sandbox refactoring.
1 parent 3574c93 commit 1ee3cb7

28 files changed

+35
-54
lines changed

LowLevel/Sandbox/Assets/Editor/SandboxManagerEditor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Linq;
2+
using UnityEditor.UIElements;
23
using UnityEngine.UIElements;
34

45
namespace UnityEditor
@@ -19,12 +20,13 @@ public override VisualElement CreateInspectorGUI()
1920

2021
// Add Start Scene.
2122
var sandboxManager = (target as SandboxManager);
22-
var sceneItems = sandboxManager.GetComponent<SceneManifest>().SceneItems;
23+
var sceneItems = sandboxManager?.GetComponent<SceneManifest>().SceneItems;
2324
var sceneNames = sceneItems.Select(item => item.Name).ToList();
25+
sceneNames.Sort();
2426
var sceneNamesField = new DropdownField { label = m_StartSceneNameProperty.displayName, choices = sceneNames, bindingPath = m_StartSceneNameProperty.propertyPath };
2527
root.Add(sceneNamesField);
2628

27-
UIHelpers.FillDefaultInspector(root, serializedObject, this, m_StartSceneNameProperty.propertyPath);
29+
InspectorElement.FillDefaultInspector(root, serializedObject, this, m_StartSceneNameProperty.propertyPath);
2830

2931
return root;
3032
}

LowLevel/Sandbox/Assets/Editor/UIHelpers.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

LowLevel/Sandbox/Assets/Editor/UIHelpers.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

LowLevel/Sandbox/Assets/Sandbox.unity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ GameObject:
196196
serializedVersion: 6
197197
m_Component:
198198
- component: {fileID: 633824030}
199-
- component: {fileID: 633824029}
200199
- component: {fileID: 633824032}
201200
- component: {fileID: 633824031}
201+
- component: {fileID: 633824029}
202202
m_Layer: 0
203203
m_Name: MainMenu
204204
m_TagString: Untagged
@@ -468,7 +468,7 @@ MonoBehaviour:
468468
m_Script: {fileID: 11500000, guid: 9b6ebc245ff03b44289ea91c3f012973, type: 3}
469469
m_Name:
470470
m_EditorClassIdentifier:
471-
StartScene: Shooter
471+
StartScene: Large World
472472
DebuggingMenu: {fileID: 1603435387}
473473
ShortcutMenu: {fileID: 465066520}
474474
UpdatePeriodFPS: 0.1

LowLevel/Sandbox/Assets/Sandbox/Scripts/SandboxManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public float CameraZoom
2222
set => m_CameraZoomElement.value = value;
2323
}
2424

25-
public bool ColorShapeState { get; private set; }
25+
private bool ColorShapeState { get; set; }
2626

2727
public string StartScene = string.Empty;
2828
public Action SceneResetAction;

LowLevel/Sandbox/Assets/Sandbox/UI/Common.meta renamed to LowLevel/Sandbox/Assets/Sandbox/UI/DebuggingMenu.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)