using UnityEngine;
using System;
using System.Collections;
using com.deeperbeige.lib;
using Holoville.HOTween;

namespace com.deeperbeige.whiteout
{
    public class Players : MonoBehaviour
    {
		private void Start()
        {
            App.inst.create();
            
			Events.Listen(Transition.EVENT_PRE_CHANGE, OnLeaveScreen,    true);
			Events.Listen(Events.EVENT_UI_DOUBLE_BACK, Application.Quit, true);
		}
		
		private void OnLeaveScreen()
		{
			HOTween.Kill();
		}
		
		private void OnClickOnePlayer()
		{
			App.inst.players = 1;
			Sounds.Play ("players-1");
			Transition.To("levelselect");
		}
		
		private void OnClickTwoPlayer()
		{
			App.inst.players = 2;
			Sounds.Play ("players-2");
			Transition.To("levelselect");
		}
		
		private void OnClickFourPlayer()
		{
			App.inst.players = 4;
			Sounds.Play ("players-4");
			Transition.To("levelselect");
		}

		private void OnClickBack()
		{
			Transition.To("intro");
		}
	}
}


