using System;
using UnityEngine;

public class McSkip : MonoBehaviour
{
	private void Init(string label)
	{
		this.m_SkipLabel = label;
	}

	private void Update()
	{
		if (Input.GetKeyDown(KeyCode.Return) && !GameMain.Instance.MainCamera.IsFadeProc() && !GameMain.Instance.MainCamera.IsFadeOut())
		{
			GameMain.Instance.ScriptMgr.adv_kag.ClearExecWait();
			GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_SkipLabel);
			GameMain.Instance.ScriptMgr.adv_kag.Exec();
		}
	}

	public static void SkipWait(string label)
	{
		GameObject gameObject = new GameObject("McSkip", new Type[]
		{
			typeof(McSkip)
		});
		gameObject.GetComponent<McSkip>().Init(label);
	}

	public static void SkipRelease()
	{
		GameObject gameObject = GameObject.Find("McSkip");
		if (gameObject)
		{
			UnityEngine.Object.Destroy(gameObject);
		}
		if (MotionAction_Mgr.Instance)
		{
			MotionAction_Mgr.Instance.ForceEnd = true;
		}
		for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
		{
			Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
			if (maid)
			{
				maid.AudioMan.Stop();
			}
		}
		GameMain.Instance.SoundMgr.StopBGM(0f);
		GameMain.Instance.SoundMgr.StopSe();
	}

	[SerializeField]
	private string m_SkipLabel;
}
