summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/CancelOrOpenPauseMenu.cs
blob: fc06deecb241e000a8fab70ce47ebd764c4830c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Rewired;
using UnityEngine;

public class CancelOrOpenPauseMenu : MonoBehaviour
{
	private Player input;

	private ChoiceManager choiceManager;

	private void Start()
	{
		input = ReInput.players.GetPlayer(0);
		choiceManager = ChoiceManager.instance;
	}

	private void Update()
	{
		if (input.GetButtonDown("Pause Menu & Cancel"))
		{
			if (choiceManager.ChoiceCoroutineRunning)
			{
				choiceManager.CancelChoice();
			}
			else
			{
				SceneTransitionManager.instance.TransitionFromGameplayToEndScreen(ScoreManager.Instance.CurrentScore, 0, 0);
			}
		}
	}
}