mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-24 00:50:59 +00:00
36 lines
882 B
C#
36 lines
882 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using InputHandler;
|
|
using MenusHandler;
|
|
|
|
public class SimpleMenu : Menu
|
|
{
|
|
public int NextLevel;
|
|
|
|
private bool _loadingNextLevel = false;
|
|
|
|
void Start()
|
|
{
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
InputManager.Instance.PushActiveContext("MainMenu", i);
|
|
InputManager.Instance.AddCallback(i, HandleMenuInput);
|
|
}
|
|
}
|
|
|
|
private void HandleMenuInput(MappedInput input)
|
|
{
|
|
if (this == null || _loadingNextLevel || !gameObject.activeSelf) return;
|
|
|
|
if (input.Actions.Contains("PlayGame"))
|
|
{
|
|
Application.LoadLevel(NextLevel);
|
|
_loadingNextLevel = true;
|
|
}
|
|
else if (input.Actions.Contains("ShowCredits"))
|
|
{
|
|
MenusManager.Instance.ShowMenu("CreditsMenu");
|
|
}
|
|
}
|
|
}
|