RootModule

RootModule
This commit is contained in:
ALEXTANG
2023-04-04 11:56:13 +08:00
parent a6069af417
commit 890723d4c9
8 changed files with 15 additions and 15 deletions

View File

@@ -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);
{

View File

@@ -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;

View File

@@ -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();

View File

@@ -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

View File

@@ -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;

View File

@@ -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>();