Roll the pause menu into the UI page system
This commit is contained in:
@@ -86,6 +86,8 @@ GameObject:
|
|||||||
- component: {fileID: 1302888740346723223}
|
- component: {fileID: 1302888740346723223}
|
||||||
- component: {fileID: 3414474029174947724}
|
- component: {fileID: 3414474029174947724}
|
||||||
- component: {fileID: 5131618775662232356}
|
- component: {fileID: 5131618775662232356}
|
||||||
|
- component: {fileID: 2284563239151529287}
|
||||||
|
- component: {fileID: 3083882772934295339}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: PauseMenu
|
m_Name: PauseMenu
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -152,6 +154,32 @@ MonoBehaviour:
|
|||||||
m_FillOrigin: 0
|
m_FillOrigin: 0
|
||||||
m_UseSpriteMesh: 0
|
m_UseSpriteMesh: 0
|
||||||
m_PixelsPerUnitMultiplier: 1
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!225 &2284563239151529287
|
||||||
|
CanvasGroup:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 667683895919791839}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_Alpha: 1
|
||||||
|
m_Interactable: 1
|
||||||
|
m_BlocksRaycasts: 1
|
||||||
|
m_IgnoreParentGroups: 0
|
||||||
|
--- !u!114 &3083882772934295339
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 667683895919791839}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: cb36c2845dc855a4c980ef9dec6ca127, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
pauseMenuPanel: {fileID: 667683895919791839}
|
||||||
|
pauseButton: {fileID: 2741683265562644894}
|
||||||
--- !u!1 &690526361960497473
|
--- !u!1 &690526361960497473
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -237,7 +265,6 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 1596438591304698361}
|
- component: {fileID: 1596438591304698361}
|
||||||
- component: {fileID: 8042868138674745223}
|
- component: {fileID: 8042868138674745223}
|
||||||
- component: {fileID: 7928661763020144797}
|
|
||||||
- component: {fileID: 8219367365545768165}
|
- component: {fileID: 8219367365545768165}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: PauseMenu
|
m_Name: PauseMenu
|
||||||
@@ -290,20 +317,6 @@ Canvas:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_TargetDisplay: 0
|
m_TargetDisplay: 0
|
||||||
--- !u!114 &7928661763020144797
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1794231825201849485}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: cb36c2845dc855a4c980ef9dec6ca127, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
pauseMenuPanel: {fileID: 667683895919791839}
|
|
||||||
pauseButton: {fileID: 2741683265562644894}
|
|
||||||
--- !u!114 &8219367365545768165
|
--- !u!114 &8219367365545768165
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -459,6 +472,7 @@ GameObject:
|
|||||||
- component: {fileID: 2451950191250215946}
|
- component: {fileID: 2451950191250215946}
|
||||||
- component: {fileID: 5498767355839153718}
|
- component: {fileID: 5498767355839153718}
|
||||||
- component: {fileID: 6435291273143630774}
|
- component: {fileID: 6435291273143630774}
|
||||||
|
- component: {fileID: 8178058650033788460}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: OpenPauseButton
|
m_Name: OpenPauseButton
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -567,7 +581,7 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: ShowPauseMenu
|
m_MethodName: ShowPauseMenu
|
||||||
m_Mode: 1
|
m_Mode: 1
|
||||||
@@ -579,6 +593,18 @@ MonoBehaviour:
|
|||||||
m_StringArgument:
|
m_StringArgument:
|
||||||
m_BoolArgument: 0
|
m_BoolArgument: 0
|
||||||
m_CallState: 2
|
m_CallState: 2
|
||||||
|
--- !u!114 &8178058650033788460
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2741683265562644894}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 494d0aedce9744308499355006071138, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: AppleHillsScripts::UI.DummyInput
|
||||||
--- !u!1 &2749636655192625148
|
--- !u!1 &2749636655192625148
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -775,7 +801,7 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: ExitGame
|
m_MethodName: ExitGame
|
||||||
m_Mode: 1
|
m_Mode: 1
|
||||||
@@ -929,7 +955,7 @@ MonoBehaviour:
|
|||||||
m_OnValueChanged:
|
m_OnValueChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: LoadLevel
|
m_MethodName: LoadLevel
|
||||||
m_Mode: 0
|
m_Mode: 0
|
||||||
@@ -1726,10 +1752,10 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: HidePauseMenu
|
m_MethodName: ResumeGame
|
||||||
m_Mode: 6
|
m_Mode: 1
|
||||||
m_Arguments:
|
m_Arguments:
|
||||||
m_ObjectArgument: {fileID: 0}
|
m_ObjectArgument: {fileID: 0}
|
||||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
@@ -1751,7 +1777,7 @@ GameObject:
|
|||||||
- component: {fileID: 2449943578766449663}
|
- component: {fileID: 2449943578766449663}
|
||||||
- component: {fileID: 2858549979657146258}
|
- component: {fileID: 2858549979657146258}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Exit (1)
|
m_Name: Reload
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
@@ -1859,7 +1885,7 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: ReloadLevel
|
m_MethodName: ReloadLevel
|
||||||
m_Mode: 1
|
m_Mode: 1
|
||||||
@@ -1992,7 +2018,7 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 7928661763020144797}
|
- m_Target: {fileID: 3083882772934295339}
|
||||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||||
m_MethodName: ExitToAppleHills
|
m_MethodName: ExitToAppleHills
|
||||||
m_Mode: 1
|
m_Mode: 1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,36 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class BackpackInput : MonoBehaviour, ITouchInputConsumer
|
|
||||||
{
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnTap(Vector2 position)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldStart(Vector2 position)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldMove(Vector2 position)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldEnd(Vector2 position)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
39
Assets/Scripts/UI/CardSystem/BackpackInput.cs
Normal file
39
Assets/Scripts/UI/CardSystem/BackpackInput.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace UI.CardSystem
|
||||||
|
{
|
||||||
|
public class BackpackInput : MonoBehaviour, ITouchInputConsumer
|
||||||
|
{
|
||||||
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTap(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldStart(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldMove(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldEnd(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
39
Assets/Scripts/UI/DummyInput.cs
Normal file
39
Assets/Scripts/UI/DummyInput.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace UI
|
||||||
|
{
|
||||||
|
public class DummyInput : MonoBehaviour, ITouchInputConsumer
|
||||||
|
{
|
||||||
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTap(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldStart(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldMove(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHoldEnd(Vector2 position)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/UI/DummyInput.cs.meta
Normal file
3
Assets/Scripts/UI/DummyInput.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 494d0aedce9744308499355006071138
|
||||||
|
timeCreated: 1761117932
|
||||||
@@ -4,10 +4,12 @@ using UnityEngine;
|
|||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using Input;
|
using Input;
|
||||||
using Bootstrap;
|
using Bootstrap;
|
||||||
|
using UI.Core;
|
||||||
|
using Pixelplacement;
|
||||||
|
|
||||||
namespace UI
|
namespace UI
|
||||||
{
|
{
|
||||||
public class PauseMenu : MonoBehaviour, ITouchInputConsumer
|
public class PauseMenu : UIPage
|
||||||
{
|
{
|
||||||
private static PauseMenu _instance;
|
private static PauseMenu _instance;
|
||||||
private static bool _isQuitting;
|
private static bool _isQuitting;
|
||||||
@@ -20,6 +22,7 @@ namespace UI
|
|||||||
[Header("UI References")]
|
[Header("UI References")]
|
||||||
[SerializeField] private GameObject pauseMenuPanel;
|
[SerializeField] private GameObject pauseMenuPanel;
|
||||||
[SerializeField] private GameObject pauseButton;
|
[SerializeField] private GameObject pauseButton;
|
||||||
|
[SerializeField] private CanvasGroup canvasGroup;
|
||||||
|
|
||||||
public event Action OnGamePaused;
|
public event Action OnGamePaused;
|
||||||
public event Action OnGameResumed;
|
public event Action OnGameResumed;
|
||||||
@@ -35,6 +38,16 @@ namespace UI
|
|||||||
{
|
{
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
||||||
|
// Ensure we have a CanvasGroup for transitions
|
||||||
|
if (canvasGroup == null)
|
||||||
|
canvasGroup = GetComponent<CanvasGroup>();
|
||||||
|
if (canvasGroup == null)
|
||||||
|
canvasGroup = gameObject.AddComponent<CanvasGroup>();
|
||||||
|
canvasGroup.alpha = 0f;
|
||||||
|
canvasGroup.interactable = false;
|
||||||
|
canvasGroup.blocksRaycasts = false;
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
|
||||||
// Register for post-boot initialization
|
// Register for post-boot initialization
|
||||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||||
}
|
}
|
||||||
@@ -90,18 +103,26 @@ namespace UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ShowPauseMenu()
|
public void ShowPauseMenu()
|
||||||
{
|
{
|
||||||
if (pauseMenuPanel != null)
|
if (_isPaused) return;
|
||||||
pauseMenuPanel.SetActive(true);
|
if (UIPageController.Instance != null)
|
||||||
|
{
|
||||||
if (pauseButton != null)
|
UIPageController.Instance.PushPage(this);
|
||||||
pauseButton.SetActive(false);
|
}
|
||||||
|
else
|
||||||
// Set paused flag and broadcast event
|
{
|
||||||
_isPaused = true;
|
// Fallback if no controller, just show
|
||||||
InputManager.Instance.SetInputMode(InputMode.UI);
|
if (pauseMenuPanel != null)
|
||||||
OnGamePaused?.Invoke();
|
pauseMenuPanel.SetActive(true);
|
||||||
|
gameObject.SetActive(true);
|
||||||
Logging.Debug("[PauseMenu] Game Paused");
|
BeginPauseSideEffects();
|
||||||
|
// no animation fallback
|
||||||
|
if (canvasGroup != null)
|
||||||
|
{
|
||||||
|
canvasGroup.alpha = 1f;
|
||||||
|
canvasGroup.interactable = true;
|
||||||
|
canvasGroup.blocksRaycasts = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -109,19 +130,33 @@ namespace UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void HidePauseMenu(bool resetInput = true)
|
public void HidePauseMenu(bool resetInput = true)
|
||||||
{
|
{
|
||||||
if (pauseMenuPanel != null)
|
if (!_isPaused)
|
||||||
pauseMenuPanel.SetActive(false);
|
{
|
||||||
|
// Ensure UI is hidden if somehow active without state
|
||||||
if (pauseButton != null)
|
if (pauseMenuPanel != null) pauseMenuPanel.SetActive(false);
|
||||||
pauseButton.SetActive(true);
|
gameObject.SetActive(false);
|
||||||
|
return;
|
||||||
// Clear paused flag and broadcast event
|
}
|
||||||
_isPaused = false;
|
if (UIPageController.Instance != null && UIPageController.Instance.CurrentPage == this)
|
||||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
{
|
||||||
if(resetInput)
|
UIPageController.Instance.PopPage();
|
||||||
OnGameResumed?.Invoke();
|
}
|
||||||
|
else
|
||||||
Logging.Debug("[PauseMenu] Game Resumed");
|
{
|
||||||
|
// Fallback if no controller, just hide
|
||||||
|
if (pauseMenuPanel != null)
|
||||||
|
pauseMenuPanel.SetActive(false);
|
||||||
|
if (pauseButton != null)
|
||||||
|
pauseButton.SetActive(true);
|
||||||
|
EndPauseSideEffects(resetInput);
|
||||||
|
if (canvasGroup != null)
|
||||||
|
{
|
||||||
|
canvasGroup.alpha = 0f;
|
||||||
|
canvasGroup.interactable = false;
|
||||||
|
canvasGroup.blocksRaycasts = false;
|
||||||
|
}
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -132,6 +167,64 @@ namespace UI
|
|||||||
HidePauseMenu();
|
HidePauseMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BeginPauseSideEffects()
|
||||||
|
{
|
||||||
|
_isPaused = true;
|
||||||
|
if (pauseButton != null) pauseButton.SetActive(false);
|
||||||
|
InputManager.Instance.SetInputMode(InputMode.UI);
|
||||||
|
OnGamePaused?.Invoke();
|
||||||
|
Logging.Debug("[PauseMenu] Game Paused");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndPauseSideEffects(bool invokeEvent)
|
||||||
|
{
|
||||||
|
_isPaused = false;
|
||||||
|
if (pauseButton != null) pauseButton.SetActive(true);
|
||||||
|
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||||
|
if (invokeEvent) OnGameResumed?.Invoke();
|
||||||
|
Logging.Debug("[PauseMenu] Game Resumed");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void DoTransitionIn(Action onComplete)
|
||||||
|
{
|
||||||
|
// Ensure the panel root is active
|
||||||
|
if (pauseMenuPanel != null) pauseMenuPanel.SetActive(true);
|
||||||
|
BeginPauseSideEffects();
|
||||||
|
|
||||||
|
if (canvasGroup != null)
|
||||||
|
{
|
||||||
|
canvasGroup.interactable = true;
|
||||||
|
canvasGroup.blocksRaycasts = true;
|
||||||
|
canvasGroup.alpha = 0f;
|
||||||
|
Tween.Value(0f, 1f, v => canvasGroup.alpha = v, transitionDuration, 0f, Tween.EaseInOut, Tween.LoopType.None, null, onComplete);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onComplete?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void DoTransitionOut(Action onComplete)
|
||||||
|
{
|
||||||
|
if (canvasGroup != null)
|
||||||
|
{
|
||||||
|
canvasGroup.interactable = false;
|
||||||
|
canvasGroup.blocksRaycasts = false;
|
||||||
|
Tween.Value(canvasGroup.alpha, 0f, v => canvasGroup.alpha = v, transitionDuration, 0f, Tween.EaseInOut, Tween.LoopType.None, null, () =>
|
||||||
|
{
|
||||||
|
EndPauseSideEffects(true);
|
||||||
|
if (pauseMenuPanel != null) pauseMenuPanel.SetActive(false);
|
||||||
|
onComplete?.Invoke();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EndPauseSideEffects(true);
|
||||||
|
if (pauseMenuPanel != null) pauseMenuPanel.SetActive(false);
|
||||||
|
onComplete?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exits to the main menu scene.
|
/// Exits to the main menu scene.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -185,25 +278,5 @@ namespace UI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnTap(Vector2 position)
|
|
||||||
{
|
|
||||||
ShowPauseMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldStart(Vector2 position)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldMove(Vector2 position)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnHoldEnd(Vector2 position)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user