You've already forked taptap2024_GJ_chidouren
update core
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
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
|
||||
{
|
||||
@@ -16,47 +20,29 @@ namespace StateSystem.State
|
||||
{
|
||||
private SceneLoader _loader;
|
||||
|
||||
public int _lastCatLevel = -1; //记录上一次的猫的等级,用于判断是否升级
|
||||
public int _lastCatLevel = -1; //记录上一次的猫的等级,用于判断是否升级
|
||||
private GameObject homeScene;
|
||||
|
||||
protected override async void OnEnter (params object[] args)
|
||||
{
|
||||
|
||||
AudioManager.Instance.PlayBGM (BgmAudio.LobbyBgm);
|
||||
GameUpdateMgr.Instance.AddUpdater (DoUpdate);
|
||||
// var activeScene = SceneManager.GetActiveScene ();
|
||||
// if (activeScene.name != SceneName.MainScene.ToString ())
|
||||
// {
|
||||
// Debug.Log ("进入Home,开始加载场景:" + SceneName.MainScene.ToString ());
|
||||
// this._loader = new SceneLoader (SceneName.MainScene);
|
||||
// this._loader.BeginLoad (OnLoading, OnActived);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// OnActived ();
|
||||
// }
|
||||
OnActived ();
|
||||
}
|
||||
|
||||
private void OnLoading (float obj)
|
||||
{
|
||||
Debug.Log ("加载进度: " + obj);
|
||||
if (obj >= 1)
|
||||
{
|
||||
// Debug.Log("加载完成");
|
||||
this._loader.Active ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnActived ()
|
||||
{
|
||||
UIManager.Instance.OpenView (UIPanel.HomePanel);
|
||||
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 ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user