summaryrefslogtreecommitdiff
path: root/GameCode/ListMenuPage.cs
blob: e4735b4e36526048e8ffc6091dbd90964480209f (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
32
33
34
35
36
using UnityEngine;

public class ListMenuPage : MonoBehaviour
{
	public ListMenuButton firstSelected;

	public float barHeight = 92f;

	private GameObject grid;

	private void Awake()
	{
		grid = base.transform.GetChild(0).gameObject;
	}

	public void Open()
	{
		ListMenu.instance.OpenPage(this);
		grid.SetActive(value: true);
	}

	public void Close()
	{
		DeselectAll();
		grid.SetActive(value: false);
	}

	private void DeselectAll()
	{
		ListMenuButton[] componentsInChildren = GetComponentsInChildren<ListMenuButton>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			componentsInChildren[i].Deselect();
		}
	}
}