diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIModule.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIModule.cs index f73867dc..4d74dbb8 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIModule.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIModule.cs @@ -18,10 +18,10 @@ namespace GameLogic private readonly List _uiStack = new List(100); - public const int LayerDeep = 2000; - public const int WindowDeep = 100; - public const int WindowHideLayer = 2; // Ignore Raycast - public const int WindowShowLayer = 5; // UI + public const int LAYER_DEEP = 2000; + public const int WINDOW_DEEP = 100; + public const int WINDOW_HIDE_LAYER = 2; // Ignore Raycast + public const int WINDOW_SHOW_LAYER = 5; // UI public static IUIResourceLoader Resource; @@ -445,13 +445,13 @@ namespace GameLogic private void OnSortWindowDepth(int layer) { - int depth = layer * LayerDeep; + int depth = layer * LAYER_DEEP; for (int i = 0; i < _uiStack.Count; i++) { if (_uiStack[i].WindowLayer == layer) { _uiStack[i].Depth = depth; - depth += WindowDeep; + depth += WINDOW_DEEP; } } } diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWidget.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWidget.cs index 0af68539..cc010fa6 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWidget.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWidget.cs @@ -265,7 +265,7 @@ namespace GameLogic for (var index = 0; index < listCanvas.Length; index++) { var childCanvas = listCanvas[index]; - childCanvas.sortingOrder = parentCanvas.sortingOrder + childCanvas.sortingOrder % UIModule.WindowDeep; + childCanvas.sortingOrder = parentCanvas.sortingOrder + childCanvas.sortingOrder % UIModule.WINDOW_DEEP; } } } diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWindow.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWindow.cs index 578f25b8..18af654e 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWindow.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Module/UIModule/UIWindow.cs @@ -138,7 +138,7 @@ namespace GameLogic { if (_canvas != null) { - return _canvas.gameObject.layer == UIModule.WindowShowLayer; + return _canvas.gameObject.layer == UIModule.WINDOW_SHOW_LAYER; } else { @@ -150,7 +150,7 @@ namespace GameLogic { if (_canvas != null) { - int setLayer = value ? UIModule.WindowShowLayer : UIModule.WindowHideLayer; + int setLayer = value ? UIModule.WINDOW_SHOW_LAYER : UIModule.WINDOW_HIDE_LAYER; if (_canvas.gameObject.layer == setLayer) return; diff --git a/UnityProject/Assets/GameScripts/Procedure/ProcedureCreateDownloader.cs b/UnityProject/Assets/GameScripts/Procedure/ProcedureCreateDownloader.cs index d7bc292b..4857ebf5 100644 --- a/UnityProject/Assets/GameScripts/Procedure/ProcedureCreateDownloader.cs +++ b/UnityProject/Assets/GameScripts/Procedure/ProcedureCreateDownloader.cs @@ -15,7 +15,7 @@ namespace Procedure { private int _curTryCount; - private const int MaxTryCount = 3; + private const int MAX_TRY_COUNT = 3; public override bool UseNativeDialog { get; } diff --git a/UnityProject/Assets/Launcher/Scripts/LoadStyle.cs b/UnityProject/Assets/Launcher/Scripts/LoadStyle.cs index f8a344e7..c7c067d7 100644 --- a/UnityProject/Assets/Launcher/Scripts/LoadStyle.cs +++ b/UnityProject/Assets/Launcher/Scripts/LoadStyle.cs @@ -18,7 +18,7 @@ namespace Launcher public Text _label_package; private Dictionary> loadConfig; - private const string ConfigPath = "RawBytes/UIStyle/Style.json"; + private const string CONFIG_PATH = "RawBytes/UIStyle/Style.json"; public enum StyleEnum { diff --git a/UnityProject/Assets/TEngine/Editor/DefineSymbols/LogScriptingDefineSymbols.cs b/UnityProject/Assets/TEngine/Editor/DefineSymbols/LogScriptingDefineSymbols.cs index 0b53399c..62d308fd 100644 --- a/UnityProject/Assets/TEngine/Editor/DefineSymbols/LogScriptingDefineSymbols.cs +++ b/UnityProject/Assets/TEngine/Editor/DefineSymbols/LogScriptingDefineSymbols.cs @@ -7,34 +7,34 @@ namespace TEngine.Editor /// public static class LogScriptingDefineSymbols { - private const string EnableLogScriptingDefineSymbol = "ENABLE_LOG"; - private const string EnableDebugAndAboveLogScriptingDefineSymbol = "ENABLE_DEBUG_AND_ABOVE_LOG"; - private const string EnableInfoAndAboveLogScriptingDefineSymbol = "ENABLE_INFO_AND_ABOVE_LOG"; - private const string EnableWarningAndAboveLogScriptingDefineSymbol = "ENABLE_WARNING_AND_ABOVE_LOG"; - private const string EnableErrorAndAboveLogScriptingDefineSymbol = "ENABLE_ERROR_AND_ABOVE_LOG"; - private const string EnableFatalAndAboveLogScriptingDefineSymbol = "ENABLE_FATAL_AND_ABOVE_LOG"; - private const string EnableDebugLogScriptingDefineSymbol = "ENABLE_DEBUG_LOG"; - private const string EnableInfoLogScriptingDefineSymbol = "ENABLE_INFO_LOG"; - private const string EnableWarningLogScriptingDefineSymbol = "ENABLE_WARNING_LOG"; - private const string EnableErrorLogScriptingDefineSymbol = "ENABLE_ERROR_LOG"; - private const string EnableFatalLogScriptingDefineSymbol = "ENABLE_FATAL_LOG"; + private const string ENABLE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_LOG"; + private const string ENABLE_DEBUG_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_DEBUG_AND_ABOVE_LOG"; + private const string ENABLE_INFO_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_INFO_AND_ABOVE_LOG"; + private const string ENABLE_WARNING_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_WARNING_AND_ABOVE_LOG"; + private const string ENABLE_ERROR_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_ERROR_AND_ABOVE_LOG"; + private const string ENABLE_FATAL_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_FATAL_AND_ABOVE_LOG"; + private const string ENABLE_DEBUG_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_DEBUG_LOG"; + private const string ENABLE_INFO_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_INFO_LOG"; + private const string ENABLE_WARNING_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_WARNING_LOG"; + private const string ENABLE_ERROR_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_ERROR_LOG"; + private const string ENABLE_FATAL_LOG_SCRIPTING_DEFINE_SYMBOL = "ENABLE_FATAL_LOG"; private static readonly string[] AboveLogScriptingDefineSymbols = new string[] { - EnableDebugAndAboveLogScriptingDefineSymbol, - EnableInfoAndAboveLogScriptingDefineSymbol, - EnableWarningAndAboveLogScriptingDefineSymbol, - EnableErrorAndAboveLogScriptingDefineSymbol, - EnableFatalAndAboveLogScriptingDefineSymbol + ENABLE_DEBUG_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_INFO_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_WARNING_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_ERROR_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_FATAL_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL }; private static readonly string[] SpecifyLogScriptingDefineSymbols = new string[] { - EnableDebugLogScriptingDefineSymbol, - EnableInfoLogScriptingDefineSymbol, - EnableWarningLogScriptingDefineSymbol, - EnableErrorLogScriptingDefineSymbol, - EnableFatalLogScriptingDefineSymbol + ENABLE_DEBUG_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_INFO_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_WARNING_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_ERROR_LOG_SCRIPTING_DEFINE_SYMBOL, + ENABLE_FATAL_LOG_SCRIPTING_DEFINE_SYMBOL }; /// @@ -43,7 +43,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Disable All Logs", false, 30)] public static void DisableAllLogs() { - ScriptingDefineSymbols.RemoveScriptingDefineSymbol(EnableLogScriptingDefineSymbol); + ScriptingDefineSymbols.RemoveScriptingDefineSymbol(ENABLE_LOG_SCRIPTING_DEFINE_SYMBOL); foreach (string specifyLogScriptingDefineSymbol in SpecifyLogScriptingDefineSymbols) { @@ -63,7 +63,7 @@ namespace TEngine.Editor public static void EnableAllLogs() { DisableAllLogs(); - ScriptingDefineSymbols.AddScriptingDefineSymbol(EnableLogScriptingDefineSymbol); + ScriptingDefineSymbols.AddScriptingDefineSymbol(ENABLE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// @@ -72,7 +72,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Enable Debug And Above Logs", false, 32)] public static void EnableDebugAndAboveLogs() { - SetAboveLogScriptingDefineSymbol(EnableDebugAndAboveLogScriptingDefineSymbol); + SetAboveLogScriptingDefineSymbol(ENABLE_DEBUG_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// @@ -81,7 +81,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Enable Info And Above Logs", false, 33)] public static void EnableInfoAndAboveLogs() { - SetAboveLogScriptingDefineSymbol(EnableInfoAndAboveLogScriptingDefineSymbol); + SetAboveLogScriptingDefineSymbol(ENABLE_INFO_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// @@ -90,7 +90,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Enable Warning And Above Logs", false, 34)] public static void EnableWarningAndAboveLogs() { - SetAboveLogScriptingDefineSymbol(EnableWarningAndAboveLogScriptingDefineSymbol); + SetAboveLogScriptingDefineSymbol(ENABLE_WARNING_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// @@ -99,7 +99,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Enable Error And Above Logs", false, 35)] public static void EnableErrorAndAboveLogs() { - SetAboveLogScriptingDefineSymbol(EnableErrorAndAboveLogScriptingDefineSymbol); + SetAboveLogScriptingDefineSymbol(ENABLE_ERROR_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// @@ -108,7 +108,7 @@ namespace TEngine.Editor [MenuItem("TEngine/Log Scripting Define Symbols/Enable Fatal And Above Logs", false, 36)] public static void EnableFatalAndAboveLogs() { - SetAboveLogScriptingDefineSymbol(EnableFatalAndAboveLogScriptingDefineSymbol); + SetAboveLogScriptingDefineSymbol(ENABLE_FATAL_AND_ABOVE_LOG_SCRIPTING_DEFINE_SYMBOL); } /// diff --git a/UnityProject/Assets/TEngine/Editor/DefineSymbols/ProfilerDefineSymbols.cs b/UnityProject/Assets/TEngine/Editor/DefineSymbols/ProfilerDefineSymbols.cs index d0dde0b6..53bfc4a0 100644 --- a/UnityProject/Assets/TEngine/Editor/DefineSymbols/ProfilerDefineSymbols.cs +++ b/UnityProject/Assets/TEngine/Editor/DefineSymbols/ProfilerDefineSymbols.cs @@ -7,13 +7,13 @@ namespace TEngine.Editor /// public class ProfilerDefineSymbols { - private const string EnableFirstProfiler = "FIRST_PROFILER"; - private const string EnableDinProFiler = "T_PROFILER"; + private const string ENABLE_FIRST_PROFILER = "FIRST_PROFILER"; + private const string ENABLE_DIN_PROFILER = "T_PROFILER"; private static readonly string[] AllProfilerDefineSymbols = new string[] { - EnableFirstProfiler, - EnableDinProFiler, + ENABLE_FIRST_PROFILER, + ENABLE_DIN_PROFILER, }; /// diff --git a/UnityProject/Assets/TEngine/Editor/Inspector/Asset/DefaultAssetInspector.cs b/UnityProject/Assets/TEngine/Editor/Inspector/Asset/DefaultAssetInspector.cs index 58d309e0..f97f3e62 100644 --- a/UnityProject/Assets/TEngine/Editor/Inspector/Asset/DefaultAssetInspector.cs +++ b/UnityProject/Assets/TEngine/Editor/Inspector/Asset/DefaultAssetInspector.cs @@ -5,7 +5,7 @@ using System.IO; [CanEditMultipleObjects, CustomEditor(typeof(DefaultAsset), false)] public class DefaultAssetInspector : Editor { - private const int MaxColum = 10240; + private const int MAX_COLUM = 10240; private GUIStyle _textStyle; @@ -34,9 +34,9 @@ public class DefaultAssetInspector : Editor else { text = luaFile; - if (text.Length > MaxColum) + if (text.Length > MAX_COLUM) { - text = text.Substring(0, MaxColum) + "...\n\n<...etc...>"; + text = text.Substring(0, MAX_COLUM) + "...\n\n<...etc...>"; } } diff --git a/UnityProject/Assets/TEngine/Editor/Inspector/Asset/TextAssetInspector.cs b/UnityProject/Assets/TEngine/Editor/Inspector/Asset/TextAssetInspector.cs index b2e7ea4f..18fb6fbd 100644 --- a/UnityProject/Assets/TEngine/Editor/Inspector/Asset/TextAssetInspector.cs +++ b/UnityProject/Assets/TEngine/Editor/Inspector/Asset/TextAssetInspector.cs @@ -5,7 +5,7 @@ using System.IO; [CanEditMultipleObjects, CustomEditor(typeof(TextAsset))] public class TextAssetInspector : Editor { - private const int MaxColum = 10240; + private const int MAX_COLUM = 10240; private GUIStyle _textStyle; @@ -35,9 +35,9 @@ public class TextAssetInspector : Editor else { text = luaFile; - if (text.Length > MaxColum) + if (text.Length > MAX_COLUM) { - text = text.Substring(0, MaxColum) + "...\n\n<...etc...>"; + text = text.Substring(0, MAX_COLUM) + "...\n\n<...etc...>"; } } diff --git a/UnityProject/Assets/TEngine/Editor/Inspector/RootModuleInspector.cs b/UnityProject/Assets/TEngine/Editor/Inspector/RootModuleInspector.cs index 4c445af1..268339ac 100644 --- a/UnityProject/Assets/TEngine/Editor/Inspector/RootModuleInspector.cs +++ b/UnityProject/Assets/TEngine/Editor/Inspector/RootModuleInspector.cs @@ -10,7 +10,7 @@ namespace TEngine.Editor [CustomEditor(typeof(RootModule))] internal sealed class RootModuleInspector : GameFrameworkInspector { - private const string NoneOptionName = ""; + private const string NONE_OPTION_NAME = ""; private static readonly float[] GameSpeed = new float[] { 0f, 0.01f, 0.1f, 0.25f, 0.5f, 1f, 1.5f, 2f, 4f, 8f }; private static readonly string[] GameSpeedForDisplay = new string[] { "0x", "0.01x", "0.1x", "0.25x", "0.5x", "1x", "1.5x", "2x", "4x", "8x" }; @@ -161,7 +161,7 @@ namespace TEngine.Editor { List textHelperTypeNames = new List { - NoneOptionName + NONE_OPTION_NAME }; textHelperTypeNames.AddRange(Type.GetRuntimeTypeNames(typeof(Utility.Text.ITextHelper))); @@ -179,7 +179,7 @@ namespace TEngine.Editor List logHelperTypeNames = new List { - NoneOptionName + NONE_OPTION_NAME }; logHelperTypeNames.AddRange(Type.GetRuntimeTypeNames(typeof(GameFrameworkLog.ILogHelper))); @@ -197,7 +197,7 @@ namespace TEngine.Editor List jsonHelperTypeNames = new List { - NoneOptionName + NONE_OPTION_NAME }; jsonHelperTypeNames.AddRange(Type.GetRuntimeTypeNames(typeof(Utility.Json.IJsonHelper))); diff --git a/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs b/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs index 6709c17f..868c17a0 100644 --- a/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs +++ b/UnityProject/Assets/TEngine/Editor/Postprocessor/SpritePostprocessor.cs @@ -38,10 +38,10 @@ public class SpritePostprocessor : AssetPostprocessor public static class EditorSpriteSaveInfo { - private const string NormalAtlasDir = "Assets/AssetArt/Atlas"; - private const string UISpritePath = "Assets/AssetRaw/UIRaw"; - private const string UIAtlasPath = "Assets/AssetRaw/UIRaw/Atlas"; - private const string UIRawPath = "Assets/AssetRaw/UIRaw/UIRaw"; + private const string NORMAL_ATLAS_DIR = "Assets/AssetArt/Atlas"; + private const string UI_SPRITE_PATH = "Assets/AssetRaw/UIRaw"; + private const string UI_ATLAS_PATH = "Assets/AssetRaw/UIRaw/Atlas"; + private const string UI_RAW_PATH = "Assets/AssetRaw/UIRaw/UIRaw"; private static readonly List _dirtyAtlasList = new List(); private static readonly Dictionary> _allASprites = new Dictionary>(); private static readonly Dictionary _uiAtlasMap = new Dictionary(); @@ -58,7 +58,7 @@ public static class EditorSpriteSaveInfo EditorApplication.update += CheckDirty; //读取所有图集信息 - string[] findAssets = AssetDatabase.FindAssets("t:SpriteAtlas", new[] { NormalAtlasDir }); + string[] findAssets = AssetDatabase.FindAssets("t:SpriteAtlas", new[] { NORMAL_ATLAS_DIR }); foreach (var findAsset in findAssets) { var path = AssetDatabase.GUIDToAssetPath(findAsset); @@ -123,7 +123,7 @@ public static class EditorSpriteSaveInfo public static void OnImportSprite(string assetPath) { - if (!assetPath.StartsWith(UISpritePath)) + if (!assetPath.StartsWith(UI_SPRITE_PATH)) { return; } @@ -134,7 +134,7 @@ public static class EditorSpriteSaveInfo { var modify = false; - if (assetPath.StartsWith(UISpritePath)) + if (assetPath.StartsWith(UI_SPRITE_PATH)) { if (ti.textureType != TextureImporterType.Sprite) { @@ -314,7 +314,7 @@ public static class EditorSpriteSaveInfo return; } - if (!assetPath.StartsWith(UISpritePath)) + if (!assetPath.StartsWith(UI_SPRITE_PATH)) { return; } @@ -332,7 +332,7 @@ public static class EditorSpriteSaveInfo return; } - if (assetPath.StartsWith(UISpritePath)) + if (assetPath.StartsWith(UI_SPRITE_PATH)) { var spriteName = Path.GetFileNameWithoutExtension(assetPath); if (_uiAtlasMap.ContainsKey(spriteName)) @@ -369,8 +369,8 @@ public static class EditorSpriteSaveInfo } } - var pathv2 = $"{NormalAtlasDir}/{atlasName}.spriteatlasv2"; - var path = $"{NormalAtlasDir}/{atlasName}.asset"; + var pathv2 = $"{NORMAL_ATLAS_DIR}/{atlasName}.spriteatlasv2"; + var path = $"{NORMAL_ATLAS_DIR}/{atlasName}.asset"; if (spriteList.Count == 0) { @@ -449,7 +449,7 @@ public static class EditorSpriteSaveInfo List needSaveAtlas = new List(); m_tempAllASprites.Clear(); _allASprites.Clear(); - var findAssets = AssetDatabase.FindAssets("t:sprite", new[] { UIAtlasPath }); + var findAssets = AssetDatabase.FindAssets("t:sprite", new[] { UI_ATLAS_PATH }); foreach (var findAsset in findAssets) { var path = AssetDatabase.GUIDToAssetPath(findAsset); diff --git a/UnityProject/Assets/TEngine/Editor/ToolbarExtender/Custom/SceneSwitcher/Editor/EditorPlayMode.cs b/UnityProject/Assets/TEngine/Editor/ToolbarExtender/Custom/SceneSwitcher/Editor/EditorPlayMode.cs index 72ea8a7b..c94f3360 100644 --- a/UnityProject/Assets/TEngine/Editor/ToolbarExtender/Custom/SceneSwitcher/Editor/EditorPlayMode.cs +++ b/UnityProject/Assets/TEngine/Editor/ToolbarExtender/Custom/SceneSwitcher/Editor/EditorPlayMode.cs @@ -26,14 +26,14 @@ namespace TEngine fixedWidth = 60 }; - ToolBarTextStyle = new GUIStyle(ButtonStyleName) + ToolBarTextStyle = new GUIStyle(BUTTON_STYLE_NAME) { padding = new RectOffset(2, 8, 2, 2), alignment = TextAnchor.MiddleCenter, fontStyle = FontStyle.Bold }; - ToolBarButtonGuiStyle = new GUIStyle(ButtonStyleName) + ToolBarButtonGuiStyle = new GUIStyle(BUTTON_STYLE_NAME) { padding = new RectOffset(2, 8, 2, 2), alignment = TextAnchor.MiddleCenter, @@ -48,7 +48,7 @@ namespace TEngine _resourceModeIndex = EditorPrefs.GetInt("EditorPlayMode", 0); } - private const string ButtonStyleName = "Tab middle"; + private const string BUTTON_STYLE_NAME = "Tab middle"; static GUIStyle _buttonGuiStyle; private static readonly string[] _resourceModeNames = diff --git a/UnityProject/Assets/TEngine/Runtime/Core/ModuleSystem.cs b/UnityProject/Assets/TEngine/Runtime/Core/ModuleSystem.cs index b61c9b1d..401590d4 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/ModuleSystem.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/ModuleSystem.cs @@ -12,12 +12,12 @@ namespace TEngine /// 默认设计的模块数量。 /// 有增删可以自行修改减少内存分配与GCAlloc。 /// - internal const int DesignModuleCount = 16; + internal const int DESIGN_MODULE_COUNT = 16; - private static readonly Dictionary _moduleMaps = new Dictionary(DesignModuleCount); + private static readonly Dictionary _moduleMaps = new Dictionary(DESIGN_MODULE_COUNT); private static readonly LinkedList _modules = new LinkedList(); private static readonly LinkedList _updateModules = new LinkedList(); - private static readonly List _updateExecuteList = new List(DesignModuleCount); + private static readonly List _updateExecuteList = new List(DESIGN_MODULE_COUNT); private static bool _isExecuteListDirty; diff --git a/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultLogHelper.cs b/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultLogHelper.cs index 0c2694ad..6cd5fd8e 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultLogHelper.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultLogHelper.cs @@ -27,7 +27,7 @@ namespace TEngine Exception, } - private const ELogLevel FilterLevel = ELogLevel.Info; + private const ELogLevel FILTER_LEVEL = ELogLevel.Info; private static readonly StringBuilder _stringBuilder = new StringBuilder(1024); /// @@ -126,7 +126,7 @@ namespace TEngine private static void LogImp(ELogLevel type, string logString) { - if (type < FilterLevel) + if (type < FILTER_LEVEL) { return; } diff --git a/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultTextHelper.cs b/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultTextHelper.cs index 5866f453..93dbf9b0 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultTextHelper.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/Utility/DefaultHelper/DefaultTextHelper.cs @@ -8,7 +8,7 @@ namespace TEngine /// public class DefaultTextHelper : Utility.Text.ITextHelper { - private const int StringBuilderCapacity = 1024; + private const int STRING_BUILDER_CAPACITY = 1024; [ThreadStatic] private static StringBuilder s_CachedStringBuilder = null; @@ -577,7 +577,7 @@ namespace TEngine { if (s_CachedStringBuilder == null) { - s_CachedStringBuilder = new StringBuilder(StringBuilderCapacity); + s_CachedStringBuilder = new StringBuilder(STRING_BUILDER_CAPACITY); } } } diff --git a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Converter.cs b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Converter.cs index 57c864fb..4f10eb5c 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Converter.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Converter.cs @@ -10,8 +10,8 @@ namespace TEngine /// public static class Converter { - private const float InchesToCentimeters = 2.54f; // 1 inch = 2.54 cm - private const float CentimetersToInches = 1f / InchesToCentimeters; // 1 cm = 0.3937 inches + private const float INCHES_TO_CENTIMETERS = 2.54f; // 1 inch = 2.54 cm + private const float CENTIMETERS_TO_INCHES = 1f / INCHES_TO_CENTIMETERS; // 1 cm = 0.3937 inches /// /// 获取数据在此计算机结构中存储时的字节顺序。 @@ -39,7 +39,7 @@ namespace TEngine throw new GameFrameworkException("You must set screen DPI first."); } - return InchesToCentimeters * pixels / ScreenDpi; + return INCHES_TO_CENTIMETERS * pixels / ScreenDpi; } /// @@ -54,7 +54,7 @@ namespace TEngine throw new GameFrameworkException("You must set screen DPI first."); } - return CentimetersToInches * centimeters * ScreenDpi; + return CENTIMETERS_TO_INCHES * centimeters * ScreenDpi; } /// diff --git a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Marshal.cs b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Marshal.cs index cbfd7fa8..752780ea 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Marshal.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Marshal.cs @@ -10,7 +10,7 @@ namespace TEngine /// 非托管内存相关的实用函数。 public static class Marshal { - private const int BlockSize = 1024 * 4; + private const int BLOCK_SIZE = 1024 * 4; private static IntPtr _cachedHGlobalPtr = IntPtr.Zero; private static int _cachedHGlobalSize = 0; @@ -33,7 +33,7 @@ namespace TEngine if (_cachedHGlobalPtr == IntPtr.Zero || _cachedHGlobalSize < ensureSize) { FreeCachedHGlobal(); - int size = (ensureSize - 1 + BlockSize) / BlockSize * BlockSize; + int size = (ensureSize - 1 + BLOCK_SIZE) / BLOCK_SIZE * BLOCK_SIZE; _cachedHGlobalPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(size); _cachedHGlobalSize = size; } diff --git a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioAgent.cs b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioAgent.cs index 443fee27..4b86f41e 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioAgent.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioAgent.cs @@ -18,7 +18,7 @@ namespace TEngine private float _volume = 1.0f; private float _duration; private float _fadeoutTimer; - private const float FadeoutDuration = 0.2f; + private const float FADEOUT_DURATION = 0.2f; private bool _inPool; /// @@ -273,7 +273,7 @@ namespace TEngine { if (fadeout) { - _fadeoutTimer = FadeoutDuration; + _fadeoutTimer = FADEOUT_DURATION; _audioAgentRuntimeState = AudioAgentRuntimeState.FadingOut; } else @@ -379,7 +379,7 @@ namespace TEngine if (_fadeoutTimer > 0f) { _fadeoutTimer -= elapseSeconds; - _source.volume = _volume * _fadeoutTimer / FadeoutDuration; + _source.volume = _volume * _fadeoutTimer / FADEOUT_DURATION; } else { diff --git a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioCategory.cs b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioCategory.cs index 9d058b02..ace64120 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioCategory.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioCategory.cs @@ -76,7 +76,7 @@ namespace TEngine this.audioMixer = audioMixer; _maxChannel = maxChannel; _audioGroupConfig = audioGroupConfig; - AudioMixerGroup[] audioMixerGroups = audioMixer.FindMatchingGroups(Utility.Text.Format("Master/{0}", audioGroupConfig.audioType.ToString())); + AudioMixerGroup[] audioMixerGroups = audioMixer.FindMatchingGroups(Utility.Text.Format("Master/{0}", audioGroupConfig.AudioType.ToString())); if (audioMixerGroups.Length > 0) { _audioMixerGroup = audioMixerGroups[0]; diff --git a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioGroupConfig.cs b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioGroupConfig.cs index 19ab12de..6a903931 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioGroupConfig.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioGroupConfig.cs @@ -22,7 +22,7 @@ namespace TEngine /// 音效分类,可分别关闭/开启对应分类音效。 /// /// 命名与AudioMixer中分类名保持一致。 - public AudioType audioType; + public AudioType AudioType; /// /// 音频源中3D声音的衰减模式。 diff --git a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioModule.cs b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioModule.cs index 536dcd6a..bfc44410 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioModule.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/AudioModule/AudioModule.cs @@ -10,9 +10,9 @@ namespace TEngine { internal class AudioModule : Module, IAudioModule, IUpdateModule { - public const string MusicVolumeName = "MusicVolume"; - public const string UISoundVolumeName = "UISoundVolume"; - public const string VoiceVolumeName = "VoiceVolume"; + public const string MUSIC_VOLUME_NAME = "MusicVolume"; + public const string UI_SOUND_VOLUME_NAME = "UISoundVolume"; + public const string VOICE_VOLUME_NAME = "VoiceVolume"; private AudioMixer _audioMixer; private Transform _instanceRoot = null; @@ -113,7 +113,7 @@ namespace TEngine float volume = Mathf.Clamp(value, 0.0001f, 1.0f); _categoriesVolume[(int)AudioType.Music] = volume; - _audioMixer.SetFloat(MusicVolumeName, Mathf.Log10(volume) * 20f); + _audioMixer.SetFloat(MUSIC_VOLUME_NAME, Mathf.Log10(volume) * 20f); } } @@ -167,7 +167,7 @@ namespace TEngine float volume = Mathf.Clamp(value, 0.0001f, 1.0f); _categoriesVolume[(int)AudioType.UISound] = volume; - _audioMixer.SetFloat(UISoundVolumeName, Mathf.Log10(volume) * 20f); + _audioMixer.SetFloat(UI_SOUND_VOLUME_NAME, Mathf.Log10(volume) * 20f); } } @@ -194,7 +194,7 @@ namespace TEngine float volume = Mathf.Clamp(value, 0.0001f, 1.0f); _categoriesVolume[(int)AudioType.Voice] = volume; - _audioMixer.SetFloat(VoiceVolumeName, Mathf.Log10(volume) * 20f); + _audioMixer.SetFloat(VOICE_VOLUME_NAME, Mathf.Log10(volume) * 20f); } } @@ -210,7 +210,7 @@ namespace TEngine return false; } - if (_audioMixer.GetFloat(MusicVolumeName, out var db)) + if (_audioMixer.GetFloat(MUSIC_VOLUME_NAME, out var db)) { return db > -80f; } @@ -231,11 +231,11 @@ namespace TEngine // 音乐采用0音量方式,避免恢复播放时的复杂逻辑 if (value) { - _audioMixer.SetFloat(MusicVolumeName, Mathf.Log10(_categoriesVolume[(int)AudioType.Music]) * 20f); + _audioMixer.SetFloat(MUSIC_VOLUME_NAME, Mathf.Log10(_categoriesVolume[(int)AudioType.Music]) * 20f); } else { - _audioMixer.SetFloat(MusicVolumeName, -80f); + _audioMixer.SetFloat(MUSIC_VOLUME_NAME, -80f); } } } @@ -389,7 +389,7 @@ namespace TEngine for (int index = 0; index < (int)AudioType.Max; ++index) { AudioType audioType = (AudioType)index; - AudioGroupConfig audioGroupConfig = _audioGroupConfigs.First(t => t.audioType == audioType); + AudioGroupConfig audioGroupConfig = _audioGroupConfigs.First(t => t.AudioType == audioType); _audioCategories[index] = new AudioCategory(audioGroupConfig.AgentHelperCount, _audioMixer, audioGroupConfig); _categoriesVolume[index] = audioGroupConfig.Volume; } diff --git a/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.RuntimeMemoryInformationWindow.cs b/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.RuntimeMemoryInformationWindow.cs index a428ca46..99bf1e09 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.RuntimeMemoryInformationWindow.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.RuntimeMemoryInformationWindow.cs @@ -11,7 +11,7 @@ namespace TEngine { private sealed partial class RuntimeMemoryInformationWindow : ScrollableDebuggerWindowBase where T : UnityEngine.Object { - private const int ShowSampleCount = 300; + private const int SHOW_SAMPLE_COUNT = 300; private readonly List _samples = new List(); private readonly Comparison _sampleComparer = SampleComparer; @@ -69,7 +69,7 @@ namespace TEngine GUILayout.EndHorizontal(); count++; - if (count >= ShowSampleCount) + if (count >= SHOW_SAMPLE_COUNT) { break; } diff --git a/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.ScrollableDebuggerWindowBase.cs b/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.ScrollableDebuggerWindowBase.cs index 42b5f6bc..ba6b4dfe 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.ScrollableDebuggerWindowBase.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/DebugerModule/Component/DebuggerModule.ScrollableDebuggerWindowBase.cs @@ -6,7 +6,7 @@ namespace TEngine { private abstract class ScrollableDebuggerWindowBase : IDebuggerWindow { - private const float TitleWidth = 240f; + private const float TITLE_WIDTH = 240f; private Vector2 _scrollPosition = Vector2.zero; public virtual void Initialize(params object[] args) @@ -44,7 +44,7 @@ namespace TEngine { GUILayout.BeginHorizontal(); { - GUILayout.Label(title, GUILayout.Width(TitleWidth)); + GUILayout.Label(title, GUILayout.Width(TITLE_WIDTH)); if (GUILayout.Button(content, "label")) { CopyToClipboard(content); diff --git a/UnityProject/Assets/TEngine/Runtime/Module/ObjectPoolModule/ObjectPoolModule.cs b/UnityProject/Assets/TEngine/Runtime/Module/ObjectPoolModule/ObjectPoolModule.cs index f405e142..c1f8aefb 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/ObjectPoolModule/ObjectPoolModule.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/ObjectPoolModule/ObjectPoolModule.cs @@ -8,9 +8,9 @@ namespace TEngine /// internal sealed partial class ObjectPoolModule : Module, IObjectPoolModule, IUpdateModule { - private const int DefaultCapacity = int.MaxValue; - private const float DefaultExpireTime = float.MaxValue; - private const int DefaultPriority = 0; + private const int DEFAULT_CAPACITY = int.MaxValue; + private const float DEFAULT_EXPIRE_TIME = float.MaxValue; + private const int DEFAULT_PRIORITY = 0; private readonly Dictionary _objectPools; private readonly List _cachedAllObjectPools; @@ -370,7 +370,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool() where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, false, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -380,7 +380,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType) { - return InternalCreateObjectPool(objectType, string.Empty, false, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, false, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -391,7 +391,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name) where T : ObjectBase { - return InternalCreateObjectPool(name, false, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(name, false, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -402,7 +402,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name) { - return InternalCreateObjectPool(objectType, name, false, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, false, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -413,7 +413,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(int capacity) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -424,7 +424,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, int capacity) { - return InternalCreateObjectPool(objectType, string.Empty, false, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -435,7 +435,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, false, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -446,7 +446,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, float expireTime) { - return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -458,7 +458,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name, int capacity) where T : ObjectBase { - return InternalCreateObjectPool(name, false, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(name, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -470,7 +470,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name, int capacity) { - return InternalCreateObjectPool(objectType, name, false, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -482,7 +482,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(name, false, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(name, false, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -494,7 +494,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name, float expireTime) { - return InternalCreateObjectPool(objectType, name, false, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, false, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -506,7 +506,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(int capacity, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, false, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -518,7 +518,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, int capacity, float expireTime) { - return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -530,7 +530,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(int capacity, int priority) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(string.Empty, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -542,7 +542,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, int capacity, int priority) { - return InternalCreateObjectPool(objectType, string.Empty, false, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(objectType, string.Empty, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -554,7 +554,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(float expireTime, int priority) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, false, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(string.Empty, false, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -566,7 +566,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, float expireTime, int priority) { - return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(objectType, string.Empty, false, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -579,7 +579,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name, int capacity, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(name, false, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(name, false, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -592,7 +592,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name, int capacity, float expireTime) { - return InternalCreateObjectPool(objectType, name, false, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, false, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -605,7 +605,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name, int capacity, int priority) where T : ObjectBase { - return InternalCreateObjectPool(name, false, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(name, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -618,7 +618,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name, int capacity, int priority) { - return InternalCreateObjectPool(objectType, name, false, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(objectType, name, false, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -631,7 +631,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public IObjectPool CreateSingleSpawnObjectPool(string name, float expireTime, int priority) where T : ObjectBase { - return InternalCreateObjectPool(name, false, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(name, false, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -644,7 +644,7 @@ namespace TEngine /// 要创建的允许单次获取的对象池。 public ObjectPoolBase CreateSingleSpawnObjectPool(Type objectType, string name, float expireTime, int priority) { - return InternalCreateObjectPool(objectType, name, false, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(objectType, name, false, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -739,7 +739,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool() where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, true, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -749,7 +749,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType) { - return InternalCreateObjectPool(objectType, string.Empty, true, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, true, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -760,7 +760,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name) where T : ObjectBase { - return InternalCreateObjectPool(name, true, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(name, true, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -771,7 +771,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name) { - return InternalCreateObjectPool(objectType, name, true, DefaultExpireTime, DefaultCapacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, true, DEFAULT_EXPIRE_TIME, DEFAULT_CAPACITY, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -782,7 +782,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(int capacity) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -793,7 +793,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, int capacity) { - return InternalCreateObjectPool(objectType, string.Empty, true, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -804,7 +804,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, true, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -815,7 +815,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, float expireTime) { - return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -827,7 +827,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name, int capacity) where T : ObjectBase { - return InternalCreateObjectPool(name, true, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(name, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -839,7 +839,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name, int capacity) { - return InternalCreateObjectPool(objectType, name, true, DefaultExpireTime, capacity, DefaultExpireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, DEFAULT_PRIORITY); } /// @@ -851,7 +851,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(name, true, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(name, true, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -863,7 +863,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name, float expireTime) { - return InternalCreateObjectPool(objectType, name, true, expireTime, DefaultCapacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, true, expireTime, DEFAULT_CAPACITY, expireTime, DEFAULT_PRIORITY); } /// @@ -875,7 +875,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(int capacity, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(string.Empty, true, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -887,7 +887,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, int capacity, float expireTime) { - return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -899,7 +899,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(int capacity, int priority) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(string.Empty, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -911,7 +911,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, int capacity, int priority) { - return InternalCreateObjectPool(objectType, string.Empty, true, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(objectType, string.Empty, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -923,7 +923,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(float expireTime, int priority) where T : ObjectBase { - return InternalCreateObjectPool(string.Empty, true, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(string.Empty, true, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -935,7 +935,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, float expireTime, int priority) { - return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(objectType, string.Empty, true, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -948,7 +948,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name, int capacity, float expireTime) where T : ObjectBase { - return InternalCreateObjectPool(name, true, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(name, true, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -961,7 +961,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name, int capacity, float expireTime) { - return InternalCreateObjectPool(objectType, name, true, expireTime, capacity, expireTime, DefaultPriority); + return InternalCreateObjectPool(objectType, name, true, expireTime, capacity, expireTime, DEFAULT_PRIORITY); } /// @@ -974,7 +974,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name, int capacity, int priority) where T : ObjectBase { - return InternalCreateObjectPool(name, true, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(name, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -987,7 +987,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name, int capacity, int priority) { - return InternalCreateObjectPool(objectType, name, true, DefaultExpireTime, capacity, DefaultExpireTime, priority); + return InternalCreateObjectPool(objectType, name, true, DEFAULT_EXPIRE_TIME, capacity, DEFAULT_EXPIRE_TIME, priority); } /// @@ -1000,7 +1000,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public IObjectPool CreateMultiSpawnObjectPool(string name, float expireTime, int priority) where T : ObjectBase { - return InternalCreateObjectPool(name, true, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(name, true, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// @@ -1013,7 +1013,7 @@ namespace TEngine /// 要创建的允许多次获取的对象池。 public ObjectPoolBase CreateMultiSpawnObjectPool(Type objectType, string name, float expireTime, int priority) { - return InternalCreateObjectPool(objectType, name, true, expireTime, DefaultCapacity, expireTime, priority); + return InternalCreateObjectPool(objectType, name, true, expireTime, DEFAULT_CAPACITY, expireTime, priority); } /// diff --git a/UnityProject/Assets/TEngine/Runtime/Module/ResourceModule/ResourceModuleDriver.cs b/UnityProject/Assets/TEngine/Runtime/Module/ResourceModule/ResourceModuleDriver.cs index d2f84491..38f37691 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/ResourceModule/ResourceModuleDriver.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/ResourceModule/ResourceModuleDriver.cs @@ -13,7 +13,7 @@ namespace TEngine { #region Propreties - private const int DefaultPriority = 0; + private const int DEFAULT_PRIORITY = 0; private IResourceModule _resourceModule; diff --git a/UnityProject/Assets/TEngine/Runtime/Module/RootModule.cs b/UnityProject/Assets/TEngine/Runtime/Module/RootModule.cs index 6c6f2176..72e55972 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/RootModule.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/RootModule.cs @@ -9,25 +9,33 @@ namespace TEngine [DisallowMultipleComponent] public sealed class RootModule : MonoBehaviour { - private const int DefaultDpi = 96; // default windows dpi + private const int DEFAULT_DPI = 96; // default windows dpi private float _gameSpeedBeforePause = 1f; - [SerializeField] private Language editorLanguage = Language.Unspecified; + [SerializeField] + private Language editorLanguage = Language.Unspecified; - [SerializeField] private string textHelperTypeName = "TEngine.DefaultTextHelper"; + [SerializeField] + private string textHelperTypeName = "TEngine.DefaultTextHelper"; - [SerializeField] private string logHelperTypeName = "TEngine.DefaultLogHelper"; + [SerializeField] + private string logHelperTypeName = "TEngine.DefaultLogHelper"; - [SerializeField] private string jsonHelperTypeName = "TEngine.DefaultJsonHelper"; + [SerializeField] + private string jsonHelperTypeName = "TEngine.DefaultJsonHelper"; - [SerializeField] private int frameRate = 120; + [SerializeField] + private int frameRate = 120; - [SerializeField] private float gameSpeed = 1f; + [SerializeField] + private float gameSpeed = 1f; - [SerializeField] private bool runInBackground = true; + [SerializeField] + private bool runInBackground = true; - [SerializeField] private bool neverSleep = true; + [SerializeField] + private bool neverSleep = true; /// /// 获取或设置编辑器语言(仅编辑器内有效)。 @@ -102,7 +110,7 @@ namespace TEngine Utility.Converter.ScreenDpi = Screen.dpi; if (Utility.Converter.ScreenDpi <= 0) { - Utility.Converter.ScreenDpi = DefaultDpi; + Utility.Converter.ScreenDpi = DEFAULT_DPI; } Application.targetFrameRate = frameRate;