summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/HowToPlayController.cs
blob: 227447877a72aaff2f883d2e7b7fdc20817c5e0f (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using UnityEngine;
using UnityEngine.SceneManagement;

public class HowToPlayController : MonoBehaviour
{
	public Transform DotParent;

	public SpriteRenderer leftButton;

	public SpriteRenderer rightButton;

	public SceneController PCMove;

	public SceneController[] Scenes;

	public int SceneNum;

	public void Start()
	{
		this.Scenes[2] = this.PCMove;
		this.PCMove.gameObject.SetActive(false);
		for (int i = 1; i < this.Scenes.Length; i++)
		{
			this.Scenes[i].gameObject.SetActive(false);
		}
		for (int j = 0; j < this.DotParent.childCount; j++)
		{
			this.DotParent.GetChild(j).localScale = Vector3.one;
		}
		this.ChangeScene(0);
	}

	public void Update()
	{
		if (Input.GetKeyUp(KeyCode.Escape))
		{
			this.Close();
		}
	}

	public void NextScene()
	{
		this.ChangeScene(1);
	}

	public void PreviousScene()
	{
		this.ChangeScene(-1);
	}

	public void Close()
	{
		SceneManager.LoadScene("MainMenu");
	}

	private void ChangeScene(int del)
	{
		this.Scenes[this.SceneNum].gameObject.SetActive(false);
		this.DotParent.GetChild(this.SceneNum).localScale = Vector3.one;
		this.SceneNum = Mathf.Clamp(this.SceneNum + del, 0, this.Scenes.Length - 1);
		this.Scenes[this.SceneNum].gameObject.SetActive(true);
		this.DotParent.GetChild(this.SceneNum).localScale = new Vector3(1.5f, 1.5f, 1.5f);
		this.leftButton.gameObject.SetActive(this.SceneNum > 0);
		this.rightButton.gameObject.SetActive(this.SceneNum < this.Scenes.Length - 1);
	}
}