Skip to main content

Class MenuPad

Provides a toggleable in-game menu that opens and closes when the Escape key is pressed.

public class MenuPad : MonoBehaviour

Inheritance​

Fields​

OnCloseMenuPressed​

Events invoked after the menu is closed.

[Tooltip("Called when the menu is hidden.")]
public UnityEvent OnCloseMenuPressed

Field Value​

UnityEvent

OnOpenMenuPressed​

Events invoked after the menu is opened.

[Tooltip("Called when the menu becomes visible.")]
public UnityEvent OnOpenMenuPressed

Field Value​

UnityEvent

Methods​

CloseMenu()​

Closes the menu UI and invokes the OnCloseMenuPressed event.

public void CloseMenu()

OpenMenu()​

Opens the menu UI and invokes the OnOpenMenuPressed event.

public void OpenMenu()

Update()​

Listens for the Escape key each frame and toggles the menu accordingly.

public void Update()
  • Fields
    • OnCloseMenuPressed
    • OnOpenMenuPressed
  • Methods
    • CloseMenu()
    • OpenMenu()
    • Update()