55 lines
1.7 KiB
C#

/// <summary>
///********************************************************
/// 脚本功能:开始状态
/// 创建人: GD
/// 创建时间: 2023/09/20 11:42
///********************************************************
/// </summary>
using System.IO;
using UnityEngine;
using ZXKFramework;
namespace DongWuYiXue.Main
{
public class GamePatternState : StateBase
{
GameModel gameModel;
public override void Init(IFSM stateMachine)
{
base.Init(stateMachine);
gameModel = MVC.GetModel<GameModel>();
//Game.Instance.uiManager.ShowUI<TimeCheckerPanel>();
//#if UNITY_EDITOR //在编辑器模式下
//#else
// if (!File.Exists(Path.GetFullPath(Path.Combine(Application.dataPath, @"../../", "encryptedData.txt"))))
// {
// Game.Instance.uiManager.ShowUI<LoadingPanel>();
// }
//#endif
}
public override void OnEnter(params object[] obj)
{
base.OnEnter(obj);
Game.Instance.uiManager.ShowUI<PatternPanel>();
Game.Instance.uiManager.ShowUI<HomePanel>();
Game.Instance.uiManager.ShowUI<TitlePanel>();
foreach (MainData mainData in gameModel.excelData.allMainData)
{
if (mainData.scene == "daoNiaoShu")
{
gameModel.mainData = mainData;
}
}
}
public override void OnExit()
{
base.OnExit();
Game.Instance.uiManager.CloseUI<PatternPanel>();
Game.Instance.uiManager.CloseUI<TitlePanel>();
Game.Instance.uiManager.CloseUI<HomePanel>();
}
}
}