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

namespace com.deeperbeige.whiteout
{
    public class LevelSelect : MonoBehaviour
    {
		private void Start()
        {
            App.inst.create();

			Events.Listen(Transition.EVENT_PRE_CHANGE,    OnLeaveScreen,     true);
			Events.Listen(Events.EVENT_UI_BACK,           OnClickBack,       true);
		}

		private void OnLeaveScreen()
		{
			HOTween.Kill();
		}

		private void OnClickEasy()
		{
			App.inst.meshParams = MeshParams.EASY;
			App.inst.levelID = "Easy";
			Sounds.Play ("difficulty-easy");
			Transition.To("game");
		}

		private void OnClickMedium()
		{
			App.inst.meshParams = MeshParams.MEDIUM;
			App.inst.levelID = "Medium";			
			Sounds.Play ("difficulty-medium");
			Transition.To("game");
		}

		private void OnClickHard()
		{
			App.inst.meshParams = MeshParams.HARD;
			Sounds.Play ("difficulty-hard");
			App.inst.levelID = "Hard";
			Transition.To("game");
		}

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


