- 引入 UnityGameFramework
- 使用 Luban 替代原来的 UGF 的数据表
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using GameFramework;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityGameFramework.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础组件。
|
||||
/// </summary>
|
||||
[DisallowMultipleComponent]
|
||||
[AddComponentMenu("Game Framework/ReferencePool")]
|
||||
public sealed class ReferencePoolComponent : GameFrameworkComponent
|
||||
{
|
||||
[SerializeField]
|
||||
private ReferenceStrictCheckType m_EnableStrictCheck = ReferenceStrictCheckType.AlwaysEnable;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否开启强制检查。
|
||||
/// </summary>
|
||||
public bool EnableStrictCheck
|
||||
{
|
||||
get
|
||||
{
|
||||
return ReferencePool.EnableStrictCheck;
|
||||
}
|
||||
set
|
||||
{
|
||||
ReferencePool.EnableStrictCheck = value;
|
||||
if (value)
|
||||
{
|
||||
Log.Info("Strict checking is enabled for the Reference Pool. It will drastically affect the performance.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 游戏框架组件初始化。
|
||||
/// </summary>
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
switch (m_EnableStrictCheck)
|
||||
{
|
||||
case ReferenceStrictCheckType.AlwaysEnable:
|
||||
EnableStrictCheck = true;
|
||||
break;
|
||||
|
||||
case ReferenceStrictCheckType.OnlyEnableWhenDevelopment:
|
||||
EnableStrictCheck = Debug.isDebugBuild;
|
||||
break;
|
||||
|
||||
case ReferenceStrictCheckType.OnlyEnableInEditor:
|
||||
EnableStrictCheck = Application.isEditor;
|
||||
break;
|
||||
|
||||
default:
|
||||
EnableStrictCheck = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ae4d40d7e878bc498492dc9c410d071
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,35 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace UnityGameFramework.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// 引用强制检查类型。
|
||||
/// </summary>
|
||||
public enum ReferenceStrictCheckType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 总是启用。
|
||||
/// </summary>
|
||||
AlwaysEnable = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 仅在开发模式时启用。
|
||||
/// </summary>
|
||||
OnlyEnableWhenDevelopment,
|
||||
|
||||
/// <summary>
|
||||
/// 仅在编辑器中启用。
|
||||
/// </summary>
|
||||
OnlyEnableInEditor,
|
||||
|
||||
/// <summary>
|
||||
/// 总是禁用。
|
||||
/// </summary>
|
||||
AlwaysDisable,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1abf21b782f0fec40bd37a5f17124b83
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user