You've already forked taptap2024_GJ_chidouren
55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using System;
|
|
using System.StateSystem;
|
|
using Framework.Asset;
|
|
using Framework.Audio;
|
|
using Framework.FSMLite;
|
|
using Framework.Timer;
|
|
using Framework.UI;
|
|
using IcecreamView;
|
|
using StateSystem.Loader;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.SceneManagement;
|
|
using Views;
|
|
using AudioType = Framework.Audio.AudioType;
|
|
using Object = UnityEngine.Object;
|
|
|
|
namespace StateSystem.State
|
|
{
|
|
public class StateHome : StateMachine<GameGlobalState>
|
|
{
|
|
private SceneLoader _loader;
|
|
|
|
public int _lastCatLevel = -1; //记录上一次的猫的等级,用于判断是否升级
|
|
private GameObject homeScene;
|
|
|
|
protected override async void OnEnter (params object[] args)
|
|
{
|
|
|
|
AudioManager.Instance.PlayBGM (BgmAudio.LobbyBgm);
|
|
GameUpdateMgr.Instance.AddUpdater (DoUpdate);
|
|
OnActived ();
|
|
}
|
|
|
|
|
|
private void OnActived ()
|
|
{
|
|
var homePart = AssetManager.Instance.LoadAlwaysAsset<GameObject> ("HomeScene.prefab");
|
|
homeScene = Object.Instantiate (homePart);
|
|
UIManager.Instance.OpenView (UIPanel.HomePanel , new IC_ViewData (this.homeScene.GetComponent<PlayableDirector> ()));
|
|
UIManager.Instance.CloseLoading (null);
|
|
}
|
|
|
|
|
|
protected override void OnExit ()
|
|
{
|
|
GameObject.Destroy (this.homeScene.gameObject);
|
|
GameUpdateMgr.Instance.RemoveUpdater (DoUpdate);
|
|
// this._loader.Kill ();
|
|
}
|
|
|
|
private void DoUpdate ()
|
|
{
|
|
}
|
|
}
|
|
} |