summaryrefslogtreecommitdiff
path: root/GameCode/GoBack.cs
blob: 2853d6d154f6e5d70a8b2fee4d3bf3dcf4a879f8 (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
31
using InControl;
using UnityEngine;
using UnityEngine.Events;

public class GoBack : MonoBehaviour
{
	public UnityEvent goBackEvent;

	public ListMenuPage target;

	private void Start()
	{
	}

	private void Update()
	{
		for (int i = 0; i < InputManager.ActiveDevices.Count; i++)
		{
			if (InputManager.ActiveDevices[i].Action2.WasPressed)
			{
				goBackEvent.Invoke();
				target.Open();
			}
		}
		if (Input.GetKeyDown(KeyCode.Escape))
		{
			goBackEvent.Invoke();
			target.Open();
		}
	}
}