using UnityEngine;
//using DG.Tweening;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;

public class LevelLoader : Singleton<LevelLoader>
{
	[SerializeField]
	private Image _image;
	[SerializeField]
	private Transform _progressElement;

	protected override void Init()
	{
		base.Init();
	}
	/*public void fadeOut(float time, float delay = 0)
	{
		if(_progressElement)
			_progressElement.DOScale(Vector3.one, .15f).ChangeStartValue(Vector3.zero);
		if(_image)
			_image.DOFade(1, time).SetDelay(delay);
	}
	public void fadeIn(float time, float delay = 0)
	{
		if (_progressElement)
			_progressElement.DOScale(Vector3.zero, .15f);
		if (_image)
			_image.DOFade(0, time).SetDelay(delay);
	}
	public void LoadLevel(int levelNum)
	{
		StartCoroutine(LoadLevelRoutine(levelNum));
	}
	private IEnumerator LoadLevelRoutine(int levelNum)
	{
		fadeOut(.5f);
		yield return new WaitForSeconds(.5f);
		AsyncOperation async = SceneManager.LoadSceneAsync(levelNum);
		while (!async.isDone)
		{
			yield return null;
		}
		fadeIn(.5f, .5f);
	}*/
}
