wip : lighting theatre & integrations
This commit is contained in:
@@ -45,12 +45,6 @@ namespace OctoCore.Components
|
||||
[Tooltip("Custom animation curve")]
|
||||
public AnimationCurve Curve = AnimationCurve.EaseInOut(0, 0, 1, 1);
|
||||
|
||||
[Tooltip("Play on Awake")]
|
||||
public bool PlayOnAwake = true;
|
||||
|
||||
[Tooltip("Delay before playing (seconds)")]
|
||||
public float Delay = 0f;
|
||||
|
||||
[Tooltip("Random Time Offset")]
|
||||
public bool RandomOffset = true;
|
||||
|
||||
@@ -90,25 +84,6 @@ namespace OctoCore.Components
|
||||
private bool _started;
|
||||
private float _timeOffset;
|
||||
|
||||
void OnDrawGizmosSelected()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_timeOffset = Time.timeSinceLevelLoad;
|
||||
_started = false;
|
||||
|
||||
if (_settings.PlayOnAwake)
|
||||
{
|
||||
if (_settings.Delay > 0f)
|
||||
StartCoroutine(DelayedStart());
|
||||
else
|
||||
_started = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
_state.InitialPosition = transform.localPosition;
|
||||
@@ -168,16 +143,6 @@ namespace OctoCore.Components
|
||||
enabled = !paused;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Waits for the configured delay then starts the animation.
|
||||
/// </summary>
|
||||
private System.Collections.IEnumerator DelayedStart()
|
||||
{
|
||||
yield return new WaitForSeconds(_settings.Delay);
|
||||
_timeOffset = Time.timeSinceLevelLoad;
|
||||
_started = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets normalized time [0,1] based on animation type.
|
||||
/// </summary>
|
||||
|
||||
@@ -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