This repository has been archived on 2024-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
sota/RunningLateGame/Assets/Scripts/OverlayCompleteUnderTimeMenu.cs

34 lines
1 KiB
C#
Raw Normal View History

/*
2024-08-11 07:51:21 +00:00
* author: mark joshwel, sai puay
* date: 11/8/2024
2024-08-11 07:51:21 +00:00
* description: script for handling win overlay functions
*/
2024-08-11 07:51:21 +00:00
using UnityEngine.UIElements;
/// <summary>
2024-08-11 07:51:21 +00:00
/// class managing the win overlay and button function invocations
/// </summary>
public class OverlayCompleteUnderTimeMenu : CommonMenu
{
2024-08-11 07:51:21 +00:00
/// <summary>
/// button to return to the main menu
/// </summary>
private Button _buttonReturn;
/// <summary>
/// function to associate a display state with the menu,
/// and subscribe button events to their respective functions
/// </summary>
public override void OnEnable()
{
// set the associated state and call the base OnEnable
associatedState = GameManager.DisplayState.OverlayCompleteUnderTimeMenu;
base.OnEnable();
2024-08-11 07:51:21 +00:00
// get the return button from the ui root and subscribe appropriate functions
_buttonReturn = UI.Q<Button>("ButtonReturn");
_buttonReturn.clicked += PlayClick;
_buttonReturn.clicked += OverlayPauseMenu.OptionReturnToMainMenu;
}
}