Update DebugX.globals.cs

This commit is contained in:
DCFApixels 2025-02-24 13:20:06 +08:00
parent 8743b77dfa
commit e6e010641f

View File

@ -1,11 +1,12 @@
using UnityEditor; using UnityEngine;
using UnityEngine; #if UNITY_EDITOR
using UnityEditor;
#endif
namespace DCFApixels namespace DCFApixels
{ {
public static unsafe partial class DebugX public static unsafe partial class DebugX
{ {
#region Globals
private const string GlobalTimeScalePrefName = "DCFApixels.DebugX.TimeScale"; private const string GlobalTimeScalePrefName = "DCFApixels.DebugX.TimeScale";
private static float _timeScaleCache; private static float _timeScaleCache;
public static float GlobalTimeScale public static float GlobalTimeScale
@ -60,13 +61,13 @@ namespace DCFApixels
EditorPrefs.DeleteKey(GlobalTimeScalePrefName); EditorPrefs.DeleteKey(GlobalTimeScalePrefName);
EditorPrefs.DeleteKey(GlobalDotSizePrefName); EditorPrefs.DeleteKey(GlobalDotSizePrefName);
EditorPrefs.DeleteKey(GlobalColorPrefName); EditorPrefs.DeleteKey(GlobalColorPrefName);
#endif
_dotSizeCache = default; _dotSizeCache = default;
_timeScaleCache = default; _timeScaleCache = default;
_globalColorCache = default; _globalColorCache = default;
InitGlobals(); InitGlobals();
#endif
} }
public static void InitGlobals() private static void InitGlobals()
{ {
GlobalTimeScale = 1; GlobalTimeScale = 1;
GlobalDotSize = 1; GlobalDotSize = 1;
@ -78,6 +79,5 @@ namespace DCFApixels
GlobalColor = (Color)(*(Color32*)&colorCode); GlobalColor = (Color)(*(Color32*)&colorCode);
#endif #endif
} }
#endregion
} }
} }