79 lines
2.0 KiB
C#
79 lines
2.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEditor.SceneManagement;
|
|
using Sirenix.OdinInspector;
|
|
using Sirenix.OdinInspector.Editor;
|
|
using Newtonsoft.Json.Bson;
|
|
using UnityEngine;
|
|
using Unity.Netcode;
|
|
|
|
public class OdinButtons : OdinEditorWindow
|
|
{
|
|
[MenuItem("Tools/Odin Buttons")]
|
|
private static void OpenWindow()
|
|
{
|
|
GetWindow<OdinButtons>().Show();
|
|
}
|
|
|
|
[BoxGroup("Editor")]
|
|
[ResponsiveButtonGroup("Editor/Group")]
|
|
private void Lobby()
|
|
{
|
|
LoadScene("Assets/Scenes/Lobby.unity");
|
|
}
|
|
|
|
[ResponsiveButtonGroup("Editor/Group")]
|
|
private void Entrance()
|
|
{
|
|
LoadScene("Assets/Scenes/Entrance.unity");
|
|
}
|
|
|
|
[ResponsiveButtonGroup("Editor/Group")]
|
|
private void Forge()
|
|
{
|
|
LoadScene("Assets/Scenes/Forge.unity");
|
|
}
|
|
|
|
[ResponsiveButtonGroup("Editor/Group")]
|
|
private void Example()
|
|
{
|
|
LoadScene("Assets/HurricaneVR/TechDemo/Scenes/scene_examples.unity");
|
|
}
|
|
|
|
[BoxGroup("Ingame switch scene")]
|
|
[ResponsiveButtonGroup("Ingame switch scene/Group"), Button("Lobby")]
|
|
private void LobbyIngame()
|
|
{
|
|
GameObject.Find("SceneManager").GetComponent<SceneManager>().SwitchToLobbyLevel();
|
|
}
|
|
|
|
[ResponsiveButtonGroup("Ingame switch scene/Group"), Button("Entrance")]
|
|
private void EntranceIngame()
|
|
{
|
|
GameObject.Find("SceneManager").GetComponent<SceneManager>().SwitchToEntranceLevel();
|
|
}
|
|
|
|
[ResponsiveButtonGroup("Ingame switch scene/Group"), Button("Forge")]
|
|
private void ForgeIngame()
|
|
{
|
|
GameObject.Find("SceneManager").GetComponent<SceneManager>().SwitchToForgeLevel();
|
|
}
|
|
|
|
[Title("Control network")]
|
|
[Button]
|
|
private void StartStopHost()
|
|
{
|
|
|
|
GameObject.Find("NetworkManager").GetComponent<NetworkManager>().StartHost();
|
|
}
|
|
|
|
private void LoadScene(string path)
|
|
{
|
|
if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
|
|
{
|
|
EditorSceneManager.OpenScene(path);
|
|
}
|
|
}
|
|
}
|