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 { public MainState mainState = MainState.Idle; private StateMachine fsm; // Start is called before the first frame update void Start() { fsm = StateMachine.Initialize(this, MainState.Idle); } /// /// 改变状态 /// /// public void SetGameState(MainState state) { mainState = state; fsm.ChangeState(mainState); } #region === 状态机接口实例 === private void Idle_Enter() { //Debug.LogFormat("进入待机状态"); TTUIPage.ShowPage(); TTUIPage.ShowPage(); TTUIPage.ShowPage(); //WebConnecter.Singleton.SendDataToWeb("装机程序进入待机状态"); } private void Idle_Update() { } private void Idle_Exit() { //Debug.LogFormat("退出待机 "); TTUIPage.ClosePage(); } 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 } }