mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Update
Update
This commit is contained in:
@@ -11,9 +11,9 @@ namespace TEngine
|
||||
|
||||
public struct OnAppClosed { }
|
||||
|
||||
public static class ApplicationContext
|
||||
public static class GameContext
|
||||
{
|
||||
public static void Initialize()
|
||||
public static void Init()
|
||||
{
|
||||
// 设置默认的线程的同步上下文
|
||||
SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Main);
|
@@ -4,16 +4,16 @@ using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public class GameAppEntry : MonoBehaviour
|
||||
public class GameSystem : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化框架
|
||||
/// 初始化框架。
|
||||
/// </summary>
|
||||
public static Scene Initialize()
|
||||
public static Scene Init()
|
||||
{
|
||||
// 初始化框架
|
||||
ApplicationContext.Initialize();
|
||||
new GameObject("[TEngine.Unity]").AddComponent<GameAppEntry>();
|
||||
GameContext.Init();
|
||||
new GameObject("[TEngine.Unity]").AddComponent<GameSystem>();
|
||||
// 框架需要一个Scene来驱动、所以要创建一个Scene、后面所有的框架都会在这个Scene下
|
||||
// 也就是把这个Scene给卸载掉、框架的东西都会清除掉
|
||||
return Scene.Create("Unity");
|
||||
@@ -33,7 +33,7 @@ namespace TEngine
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
EventSystem.Instance?.Publish(new OnAppClosed());
|
||||
ApplicationContext.Close();
|
||||
GameContext.Close();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user