wip : lighting theatre & integrations
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
using OctoCore.Navigation.Data;
|
||||
using OctoCore.UI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.Navigation
|
||||
{
|
||||
/// <summary>
|
||||
/// Main menu manager.
|
||||
/// Handles Play, Quit and optional extra buttons.
|
||||
/// Relies on OctoCore.Navigation for scene loading.
|
||||
/// </summary>
|
||||
public class OctoMainMenu : MonoBehaviour
|
||||
{
|
||||
[Header("Scene Settings")]
|
||||
[SerializeField, Tooltip("First scene to load on Play")]
|
||||
private OctoSceneData _firstSceneData;
|
||||
|
||||
[Header("UI Settings")]
|
||||
[SerializeField, Tooltip("Optional panel to show/hide (options, credits...)")]
|
||||
private GameObject _optionalPanel;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// Hide optional panel on start if assigned
|
||||
if (_optionalPanel)
|
||||
_optionalPanel.SetActive(false);
|
||||
|
||||
// Make sure cursor is visible in main menu
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the first scene. Called by the Play button.
|
||||
/// </summary>
|
||||
public void OnPlayButton()
|
||||
{
|
||||
if (!OctoCore.Instance)
|
||||
{
|
||||
Debug.LogError("[OctoMainMenu] OctoCore instance not found");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_firstSceneData == null)
|
||||
{
|
||||
Debug.LogError("[OctoMainMenu] FirstSceneData is null");
|
||||
return;
|
||||
}
|
||||
|
||||
OctoCore.Instance.Navigation.LoadScene(_firstSceneData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Quit the application. Called by the Quit button.
|
||||
/// </summary>
|
||||
public void OnQuitButton()
|
||||
{
|
||||
Application.Quit();
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle an optional panel (options, credits...). Called by any extra button.
|
||||
/// </summary>
|
||||
public void OnTogglePanel()
|
||||
{
|
||||
if (_optionalPanel)
|
||||
_optionalPanel.SetActive(!_optionalPanel.activeSelf);
|
||||
}
|
||||
|
||||
// --- Add your custom button methods below ---
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2316e64f670a6bc4cbacd94afda36404
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user