You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.2 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LzFramework.UI;
using LzFramework.FSM;
using LzFramework;
using EduCoderTool;
namespace DisComputer
{
/*
*@func 主流程控制器
* @author lz
* @data 2020/05/26
*/
public class MainControl : Singleton<MainControl>
{
public MainState mainState = MainState.Idle;
private StateMachine<MainState> fsm;
// Start is called before the first frame update
void Start()
{
fsm = StateMachine<MainState>.Initialize(this, MainState.Idle);
}
/// <summary>
/// 改变状态
/// </summary>
/// <param name="state"></param>
public void SetGameState(MainState state)
{
mainState = state;
fsm.ChangeState(mainState);
}
#region === 状态机接口实例 ===
private void Idle_Enter()
{
//Debug.LogFormat("进入待机状态");
TTUIPage.ShowPage<MainMenuView>();
TTUIPage.ShowPage<TipView>();
TTUIPage.ShowPage<IdleView>();
//WebConnecter.Singleton.SendDataToWeb("装机程序进入待机状态");
}
private void Idle_Update()
{
}
private void Idle_Exit()
{
//Debug.LogFormat("退出待机 ");
TTUIPage.ClosePage<IdleView>();
}
private IEnumerator Active_Enter()
{
yield return new WaitForEndOfFrame();
//Debug.LogFormat("游戏状态");
//WebConnecter.Singleton.SendDataToWeb("装机程序进入组装状态");
}
private void Active_Update()
{
//Debug.LogFormat("游戏中。。。");
}
private void Active_Exit()
{
//Debug.LogFormat("退出游戏状态");
}
private void End_Enter()
{
//Debug.LogFormat("进入游戏结束状态");
}
private void End_Exit()
{
//Debug.LogFormat("退出游戏结束状态");
}
#endregion
}
public enum MainState
{
Idle,
Active,
End
}
}