add ui pack
This commit is contained in:
@@ -83,6 +83,7 @@ public class PlayerComponent : NetworkBehaviour
|
||||
foreach (var t in new[]
|
||||
{
|
||||
typeof(UniversalAdditionalCameraData),
|
||||
typeof(HandMenuUI)
|
||||
})
|
||||
{
|
||||
foreach (var component in GetComponentsInChildren(t))
|
||||
|
||||
@@ -5,6 +5,8 @@ using UnityEditor.SceneManagement;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Newtonsoft.Json.Bson;
|
||||
using UnityEngine;
|
||||
using Unity.Netcode;
|
||||
|
||||
public class OdinButtons : OdinEditorWindow
|
||||
{
|
||||
@@ -14,30 +16,58 @@ public class OdinButtons : OdinEditorWindow
|
||||
GetWindow<OdinButtons>().Show();
|
||||
}
|
||||
|
||||
[Button]
|
||||
private void LobbyScene()
|
||||
[BoxGroup("Editor")]
|
||||
[ResponsiveButtonGroup("Editor/Group")]
|
||||
private void Lobby()
|
||||
{
|
||||
LoadScene("Assets/Scenes/Lobby.unity");
|
||||
}
|
||||
|
||||
[Button]
|
||||
private void EntranceScene()
|
||||
[ResponsiveButtonGroup("Editor/Group")]
|
||||
private void Entrance()
|
||||
{
|
||||
LoadScene("Assets/Scenes/Entrance.unity");
|
||||
}
|
||||
|
||||
[Button]
|
||||
private void ForgeScene()
|
||||
[ResponsiveButtonGroup("Editor/Group")]
|
||||
private void Forge()
|
||||
{
|
||||
LoadScene("Assets/Scenes/Forge.unity");
|
||||
}
|
||||
|
||||
[Button]
|
||||
private void HurricaneExample()
|
||||
[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())
|
||||
|
||||
@@ -132,12 +132,24 @@ public class SceneManager : NetworkBehaviour
|
||||
CheckStatus(status, false);
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void SwitchToLobbyLevel()
|
||||
{
|
||||
StartCoroutine(SwitchToSceneMultiplayer(lobbySceneName));
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void SwitchToEntranceLevel()
|
||||
{
|
||||
StartCoroutine(SwitchToSceneMultiplayer(entranceSceneName));
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void SwitchToForgeLevel()
|
||||
{
|
||||
StartCoroutine(SwitchToSceneMultiplayer(forgeSceneName));
|
||||
}
|
||||
|
||||
private IEnumerator SwitchToSceneMultiplayer(string scene)
|
||||
{
|
||||
//gameManager.LocalPlayer.FadeScreen(1, fadeDuration);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class HandMenuUI : MonoBehaviour
|
||||
{
|
||||
canvas = GetComponent<Canvas>();
|
||||
|
||||
uiInput.AddCanvas(canvas);
|
||||
uiInput?.AddCanvas(canvas);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
Reference in New Issue
Block a user