Update ScenePartitionSOEditor.cs

This commit is contained in:
max 2023-07-09 23:08:55 +02:00
parent 8b44c33813
commit d859ad1af5

View File

@ -39,33 +39,28 @@ public override void OnInspectorGUI()
EditorGUIUtils.HorizontalLine(); EditorGUIUtils.HorizontalLine();
using (new EditorGUILayout.HorizontalScope()) if (GUILayout.Button("Load All"))
{
if (GUILayout.Button("Load All", EditorStyles.miniButtonLeft))
{ {
scenePartitionSO.LoadAll(); scenePartitionSO.LoadAll();
} }
if (GUILayout.Button("Unload", EditorStyles.miniButtonRight)) using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button(new GUIContent("Unload", "Empty the scene and save it (so it has no changes in source control)."), EditorStyles.miniButtonLeft))
{ {
scenePartitionSO.Unload(); scenePartitionSO.Unload();
} }
}
using (new EditorGUILayout.HorizontalScope()) if (GUILayout.Button(new GUIContent("Reload", "Discard changes and reload loaded partitions."), EditorStyles.miniButtonRight))
{
if (GUILayout.Button("Save", EditorStyles.miniButtonLeft))
{
scenePartitionSO.Save();
}
if (GUILayout.Button(new GUIContent("Reload", "Discard changes and reload"), EditorStyles.miniButtonRight))
{ {
scenePartitionSO.Reload(); scenePartitionSO.Reload();
} }
} }
EditorGUIUtils.HorizontalLine(); if (GUILayout.Button("Save"))
{
scenePartitionSO.Save();
}
using (new EditorGUILayout.HorizontalScope()) using (new EditorGUILayout.HorizontalScope())
{ {
@ -87,6 +82,8 @@ public override void OnInspectorGUI()
} }
if (scenePartitionSO.Data.SceneGrid != null) if (scenePartitionSO.Data.SceneGrid != null)
{
using (new EditorGUILayout.HorizontalScope())
{ {
gridId = EditorGUILayout.IntField("gridId", gridId); gridId = EditorGUILayout.IntField("gridId", gridId);
@ -94,6 +91,9 @@ public override void OnInspectorGUI()
{ {
scenePartitionSO.LoadCell(gridId); scenePartitionSO.LoadCell(gridId);
} }
}
EditorGUIUtils.HorizontalLine();
using (EditorGUIUtils.FoldoutHeaderScope foldoutGroup = new EditorGUIUtils.FoldoutHeaderScope("gridData", ref foldoutGroupEnabled)) using (EditorGUIUtils.FoldoutHeaderScope foldoutGroup = new EditorGUIUtils.FoldoutHeaderScope("gridData", ref foldoutGroupEnabled))
{ {