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();
using (new EditorGUILayout.HorizontalScope())
if (GUILayout.Button("Load All"))
{
if (GUILayout.Button("Load All", EditorStyles.miniButtonLeft))
{
scenePartitionSO.LoadAll();
}
if (GUILayout.Button("Unload", EditorStyles.miniButtonRight))
{
scenePartitionSO.Unload();
}
scenePartitionSO.LoadAll();
}
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Save", EditorStyles.miniButtonLeft))
if (GUILayout.Button(new GUIContent("Unload", "Empty the scene and save it (so it has no changes in source control)."), EditorStyles.miniButtonLeft))
{
scenePartitionSO.Save();
scenePartitionSO.Unload();
}
if (GUILayout.Button(new GUIContent("Reload", "Discard changes and reload"), EditorStyles.miniButtonRight))
if (GUILayout.Button(new GUIContent("Reload", "Discard changes and reload loaded partitions."), EditorStyles.miniButtonRight))
{
scenePartitionSO.Reload();
}
}
EditorGUIUtils.HorizontalLine();
if (GUILayout.Button("Save"))
{
scenePartitionSO.Save();
}
using (new EditorGUILayout.HorizontalScope())
{
@ -88,13 +83,18 @@ public override void OnInspectorGUI()
if (scenePartitionSO.Data.SceneGrid != null)
{
gridId = EditorGUILayout.IntField("gridId", gridId);
if (GUILayout.Button("LoadSceneGrid"))
using (new EditorGUILayout.HorizontalScope())
{
scenePartitionSO.LoadCell(gridId);
gridId = EditorGUILayout.IntField("gridId", gridId);
if (GUILayout.Button("LoadSceneGrid"))
{
scenePartitionSO.LoadCell(gridId);
}
}
EditorGUIUtils.HorizontalLine();
using (EditorGUIUtils.FoldoutHeaderScope foldoutGroup = new EditorGUIUtils.FoldoutHeaderScope("gridData", ref foldoutGroupEnabled))
{
if (!foldoutGroupEnabled) return;