Add editor to change scenes quickly
This commit is contained in:
36
Assets/Scripts/Editor/OdinButtons.cs
Normal file
36
Assets/Scripts/Editor/OdinButtons.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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();
|
||||
}
|
||||
|
||||
[ButtonGroup]
|
||||
private void ForgeScene()
|
||||
{
|
||||
LoadScene("Assets/Scenes/Forge.unity");
|
||||
}
|
||||
|
||||
[ButtonGroup]
|
||||
private void HurricaneExample()
|
||||
{
|
||||
LoadScene("Assets/HurricaneVR/TechDemo/Scenes/scene_examples.unity");
|
||||
}
|
||||
|
||||
private void LoadScene(string path)
|
||||
{
|
||||
if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
|
||||
{
|
||||
EditorSceneManager.OpenScene(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user