add : credits screen
This commit is contained in:
@@ -3,6 +3,7 @@ using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using OctoCore.Navigation;
|
||||
|
||||
// Holds a graphic target with its own normal and highlighted colors
|
||||
[Serializable]
|
||||
@@ -59,7 +60,10 @@ public class MultiTargetButton : MonoBehaviour,
|
||||
}
|
||||
|
||||
// Mouse
|
||||
public void OnPointerEnter(PointerEventData e) => Activate();
|
||||
public void OnPointerEnter(PointerEventData e) {
|
||||
if (Time.time < OctoMainMenu.IgnoreMouseUntil) return;
|
||||
Activate();
|
||||
}
|
||||
public void OnPointerExit(PointerEventData e) {
|
||||
// If persist is on, do nothing on exit — next Activate() will clean up
|
||||
if (!PersistLastHovered) SetHighlight(false);
|
||||
|
||||
@@ -3,6 +3,7 @@ using OctoCore.Navigation.Data;
|
||||
using OctoCore.UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace OctoCore.Navigation
|
||||
@@ -104,18 +105,28 @@ namespace OctoCore.Navigation
|
||||
}
|
||||
}
|
||||
|
||||
// --- Add your custom button methods below ---
|
||||
public void SelectMainDefaultButton()
|
||||
{
|
||||
StartCoroutine(SelectAfterFrame(_mainPanelDefaultButton));
|
||||
}
|
||||
|
||||
public void SelectDebugFirstButton()
|
||||
{
|
||||
EventSystem.current.SetSelectedGameObject(_optionalPanelFirstButton.gameObject);
|
||||
StartCoroutine(SelectAfterFrame(_optionalPanelFirstButton));
|
||||
}
|
||||
|
||||
public void SelectMainDefaultButton()
|
||||
private IEnumerator SelectAfterFrame(Button button)
|
||||
{
|
||||
EventSystem.current.SetSelectedGameObject(_mainPanelDefaultButton.gameObject);
|
||||
MultiTargetButton.ClearPersistence();
|
||||
EventSystem.current.SetSelectedGameObject(button.gameObject);
|
||||
|
||||
// Ignore mouse hover for 0.1s so it doesn't steal selection
|
||||
OctoMainMenu.IgnoreMouseUntil = Time.time + 0.1f;
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Exposed so MultiTargetButton can check before activating on hover
|
||||
public static float IgnoreMouseUntil = 0f;
|
||||
public void ClearButtonPersistence()
|
||||
{
|
||||
MultiTargetButton.ClearPersistence();
|
||||
|
||||
Reference in New Issue
Block a user