using UnityEngine;
using System.Collections;
using InControl;

public class ScreenManager : MonoBehaviour {

	public string nextScreen;
	public string previousScreen;

	private InputDevice inputDevice;
	private int playerNum = 0;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		inputDevice = (InputManager.Devices.Count > playerNum) ? InputManager.Devices[playerNum] : null;
		if (inputDevice != null)
		{
			if(inputDevice.Action1.WasPressed){
				if(nextScreen != null && nextScreen != ""){
					AudioController.Play("tap");
					Application.LoadLevel(nextScreen);
				}
			}

			if(inputDevice.Action2.WasPressed){
				if(previousScreen != null && previousScreen != ""){
					AudioController.Play("tap");
					Application.LoadLevel(previousScreen);
				}
			}
		}
	}
}
