mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
RootModule
RootModule
This commit is contained in:
@@ -6,8 +6,8 @@ using UnityEngine;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
[CustomEditor(typeof(RootComponent))]
|
||||
internal sealed class RootComponentInspector : GameFrameworkInspector
|
||||
[CustomEditor(typeof(RootModule))]
|
||||
internal sealed class RootModuleInspector : GameFrameworkInspector
|
||||
{
|
||||
private const string NoneOptionName = "<None>";
|
||||
private static readonly float[] GameSpeed = new float[] { 0f, 0.01f, 0.1f, 0.25f, 0.5f, 1f, 1.5f, 2f, 4f, 8f };
|
||||
@@ -41,7 +41,7 @@ namespace TEngine.Editor
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
RootComponent t = (RootComponent)target;
|
||||
RootModule t = (RootModule)target;
|
||||
|
||||
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
||||
{
|
@@ -9,14 +9,14 @@ namespace TEngine
|
||||
{
|
||||
private sealed class EnvironmentInformationWindow : ScrollableDebuggerWindowBase
|
||||
{
|
||||
private RootComponent m_RootComponent = null;
|
||||
private RootModule _mRootModule = null;
|
||||
|
||||
private ResourceComponent m_ResourceComponent = null;
|
||||
|
||||
public override void Initialize(params object[] args)
|
||||
{
|
||||
m_RootComponent = GameEntry.GetComponent<RootComponent>();
|
||||
if (m_RootComponent == null)
|
||||
_mRootModule = GameEntry.GetComponent<RootModule>();
|
||||
if (_mRootModule == null)
|
||||
{
|
||||
Log.Fatal("Base component is invalid.");
|
||||
return;
|
||||
|
@@ -78,11 +78,11 @@ namespace TEngine
|
||||
{
|
||||
Log.Info("Shutdown Game Framework ({0})...", shutdownType);
|
||||
Utility.Unity.Release();
|
||||
RootComponent rootComponent = GetComponent<RootComponent>();
|
||||
if (rootComponent != null)
|
||||
RootModule rootModule = GetComponent<RootModule>();
|
||||
if (rootModule != null)
|
||||
{
|
||||
rootComponent.Shutdown();
|
||||
rootComponent = null;
|
||||
rootModule.Shutdown();
|
||||
rootModule = null;
|
||||
}
|
||||
|
||||
s_GameFrameworkComponents.Clear();
|
||||
|
@@ -8,7 +8,7 @@ namespace TEngine
|
||||
/// 基础组件。
|
||||
/// </summary>
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class RootComponent : GameFrameworkComponent
|
||||
public sealed class RootModule : GameFrameworkComponent
|
||||
{
|
||||
private const int DefaultDpi = 96; // default windows dpi
|
||||
|
@@ -63,8 +63,8 @@ namespace TEngine
|
||||
|
||||
private void Start()
|
||||
{
|
||||
RootComponent rootComponent = GameEntry.GetComponent<RootComponent>();
|
||||
if (rootComponent == null)
|
||||
RootModule rootModule = GameEntry.GetComponent<RootModule>();
|
||||
if (rootModule == null)
|
||||
{
|
||||
Log.Fatal("Base component is invalid.");
|
||||
return;
|
||||
|
@@ -12,7 +12,7 @@ public class GameModule:MonoBehaviour
|
||||
/// <summary>
|
||||
/// 获取游戏基础模块。
|
||||
/// </summary>
|
||||
public static RootComponent Base { get; private set; }
|
||||
public static RootModule Base { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取调试模块。
|
||||
@@ -51,7 +51,7 @@ public class GameModule:MonoBehaviour
|
||||
/// </summary>
|
||||
public static void InitFrameWorkComponents()
|
||||
{
|
||||
Base = Get<RootComponent>();
|
||||
Base = Get<RootModule>();
|
||||
Debugger = Get<DebuggerComponent>();
|
||||
Fsm = Get<FsmComponent>();
|
||||
ObjectPool = Get<ObjectPoolComponent>();
|
||||
|
Reference in New Issue
Block a user