Files
dungeons/Assets/Scripts/Editor/OdinButtons.cs
2024-08-13 20:38:56 +02:00

43 lines
931 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.SceneManagement;
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
using Newtonsoft.Json.Bson;
public class OdinButtons : OdinEditorWindow
{
[MenuItem("Tools/Odin Buttons")]
private static void OpenWindow()
{
GetWindow<OdinButtons>().Show();
}
[Button]
private void EntranceScene()
{
LoadScene("Assets/Scenes/Entrance.unity");
}
[Button]
private void ForgeScene()
{
LoadScene("Assets/Scenes/Forge.unity");
}
[Button]
private void HurricaneExample()
{
LoadScene("Assets/HurricaneVR/TechDemo/Scenes/scene_examples.unity");
}
private void LoadScene(string path)
{
if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
{
EditorSceneManager.OpenScene(path);
}
}
}