using System;
using UnityEngine;

public class SceneTryInfo : MonoBehaviour
{
	private void Start()
	{
		GameMain.Instance.SysShortcut.gameObject.SetActive(false);
		GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
		GameMain.Instance.MainCamera.FadeIn(3f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeIn), true, true, default(Color));
		this.m_eMode = SceneTryInfo.Mode.FadeIn;
	}

	private void Update()
	{
		if (this.m_eMode == SceneTryInfo.Mode.ClickWait && !GameMain.Instance.CharacterMgr.IsBusy() && this.GetAnyMouseAndKey())
		{
			GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.IClick);
			GameMain.Instance.MainCamera.FadeOut(1.5f, false, new CameraMain.dgOnCompleteFade(this.OnCompleteFadeOut), true, default(Color));
			this.m_eMode = SceneTryInfo.Mode.FadeOut;
		}
	}

	private void OnCompleteFadeIn()
	{
		this.m_eMode = SceneTryInfo.Mode.ClickWait;
	}

	private void OnCompleteFadeOut()
	{
		GameMain.Instance.LoadScene("SceneToTitle");
	}

	private bool GetAnyMouseAndKey()
	{
		return NInput.GetMouseButtonUp(0) || NInput.GetMouseButtonUp(1) || NInput.GetMouseButtonUp(2) || Input.GetKeyUp(KeyCode.Return) || GameMain.Instance.IsForceSkip();
	}

	private SceneTryInfo.Mode m_eMode;

	private enum Mode
	{
		FadeIn,
		ClickWait,
		FadeOut
	}
}
