diff --git a/Assets/TEngine/Runtime/Core/BehaviourSingleton.cs b/Assets/TEngine/Runtime/Core/BehaviourSingleton.cs
index 77932744..e0f9d683 100644
--- a/Assets/TEngine/Runtime/Core/BehaviourSingleton.cs
+++ b/Assets/TEngine/Runtime/Core/BehaviourSingleton.cs
@@ -15,9 +15,9 @@ namespace TEngine
{
if (null == sInstance)
{
- if (!TEngine.Instance.ContainLogicSys(BehaviourSingleSystem.Instance))
+ if (!TEngineEntry.Instance.ContainLogicSys(BehaviourSingleSystem.Instance))
{
- TEngine.Instance.AddLogicSys(BehaviourSingleSystem.Instance);
+ TEngineEntry.Instance.AddLogicSys(BehaviourSingleSystem.Instance);
}
sInstance = new T();
TLogger.LogAssert(sInstance != null);
diff --git a/Assets/TEngine/Runtime/Core/GameEntry.cs b/Assets/TEngine/Runtime/Core/GameEntry.cs
new file mode 100644
index 00000000..3ca50449
--- /dev/null
+++ b/Assets/TEngine/Runtime/Core/GameEntry.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TEngine;
+using UnityEngine;
+
+namespace Assets.TEngine.Runtime.Core
+{
+ public class GameEntry:MonoBehaviour
+ {
+ void Start()
+ {
+ TEngineEntry.Instance.OnStartGame += OnStartGame;
+ }
+
+ void OnStartGame()
+ {
+ TLogger.LogError("OnStartGame");
+ }
+ }
+}
diff --git a/Assets/TEngine/Runtime/Core/TEngine.cs.meta b/Assets/TEngine/Runtime/Core/GameEntry.cs.meta
similarity index 83%
rename from Assets/TEngine/Runtime/Core/TEngine.cs.meta
rename to Assets/TEngine/Runtime/Core/GameEntry.cs.meta
index b6b4ac5f..3bb6bf6a 100644
--- a/Assets/TEngine/Runtime/Core/TEngine.cs.meta
+++ b/Assets/TEngine/Runtime/Core/GameEntry.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: eab97947b9db71a47b27c473727f40bb
+guid: 92823e5f43d656747901c60b79aeb51c
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/TEngine/Runtime/Core/TEngine.cs b/Assets/TEngine/Runtime/Core/TEngineEntry.cs
similarity index 89%
rename from Assets/TEngine/Runtime/Core/TEngine.cs
rename to Assets/TEngine/Runtime/Core/TEngineEntry.cs
index 83449416..79dd2734 100644
--- a/Assets/TEngine/Runtime/Core/TEngine.cs
+++ b/Assets/TEngine/Runtime/Core/TEngineEntry.cs
@@ -3,24 +3,14 @@ using UnityEngine;
namespace TEngine
{
- ///
- /// 游戏入口,派生TEngine,实现进入游戏虚函数(override StartGame)
- ///
- public class TEngine : UnitySingleton
+ public class TEngineEntry : UnitySingleton
{
- public override void Awake()
+ public System.Action OnStartGame;
+ protected override void OnLoad()
{
- base.Awake();
-
- TLogger.LogInfo($"DevicePerformanceLevel 设备性能评级:{DevicePerformanceUtil.GetDevicePerformanceLevel()}");
-
InitLibImp();
RegisterAllSystem();
-
- AfterAwake();
-
- GameTime.StartFrame();
}
///
@@ -167,16 +157,10 @@ namespace TEngine
SingletonMgr.Release();
}
- protected virtual void AfterAwake()
- {
-
- }
-
protected virtual void StartGame()
{
-
+ OnStartGame?.Invoke();
}
-
#endregion
}
}
\ No newline at end of file
diff --git a/Assets/TEngine/Runtime/Core/TEngineEntry.cs.meta b/Assets/TEngine/Runtime/Core/TEngineEntry.cs.meta
new file mode 100644
index 00000000..daefc487
--- /dev/null
+++ b/Assets/TEngine/Runtime/Core/TEngineEntry.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 24d05fd49961e7848a44005a652f95c9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: