using UnityEngine;
using System.Collections;

public class IntroDialogue : MonoBehaviour {

	int pageIndex = 0;

	public GameObject introSheet;
	public GameObject instructionSheet;
	public GameObject[] pages;

	public void StartInstructions() {
		introSheet.SetActive(false);
		instructionSheet.SetActive(true);

		foreach(GameObject p in pages)
			p.SetActive(false);

		pages[0].SetActive(true);
		pageIndex = 0;
	}

	public void NextPage() {
		pages[pageIndex].SetActive(false);
		pageIndex = Mathf.Clamp(pageIndex + 1, 0, pages.Length-1);
		pages[pageIndex].SetActive(true);
	}
	
	public void PrevPage() {
		pages[pageIndex].SetActive(false);
		pageIndex = Mathf.Clamp(pageIndex - 1, 0, pages.Length-1);
		pages[pageIndex].SetActive(true);
	}

	public void StartGame() {
		Application.LoadLevel("_SCENE_");
	}

	public void Exit() {
		Application.Quit();
	}
	
}
