- 添加 MainForm
- 添加 ResolutionAdapterComponent 进行屏幕分辨率适配
This commit is contained in:
@@ -1,31 +1,25 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using CustomComponent;
|
||||
using CustomComponent;
|
||||
using GeometryTD.CustomComponent;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏入口。
|
||||
/// </summary>
|
||||
public partial class GameEntry : MonoBehaviour
|
||||
public partial class GameEntry
|
||||
{
|
||||
public static BuiltinDataComponent BuiltinData { get; private set; }
|
||||
|
||||
public static HPBarComponent HPBar { get; private set; }
|
||||
|
||||
public static UIRouterComponent UIRouter { get; private set; }
|
||||
|
||||
|
||||
public static EventNodeComponent EventNode { get; private set; }
|
||||
|
||||
public static CombatNodeComponent CombatNode { get; private set; }
|
||||
|
||||
|
||||
public static ShopNodeComponent ShopNode { get; private set; }
|
||||
|
||||
public static ResolutionAdapterComponent ResolutionAdapter { get; private set; }
|
||||
|
||||
private static void InitCustomComponents()
|
||||
{
|
||||
BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent<BuiltinDataComponent>();
|
||||
@@ -34,5 +28,11 @@ public partial class GameEntry : MonoBehaviour
|
||||
EventNode = UnityGameFramework.Runtime.GameEntry.GetComponent<EventNodeComponent>();
|
||||
CombatNode = UnityGameFramework.Runtime.GameEntry.GetComponent<CombatNodeComponent>();
|
||||
ShopNode = UnityGameFramework.Runtime.GameEntry.GetComponent<ShopNodeComponent>();
|
||||
ResolutionAdapter = UnityGameFramework.Runtime.GameEntry.GetComponent<ResolutionAdapterComponent>();
|
||||
if (ResolutionAdapter == null)
|
||||
{
|
||||
UnityGameFramework.Runtime.Log.Warning(
|
||||
"ResolutionAdapterComponent is missing. Please add it in Launcher scene and inject UI roots.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user