diff --git a/Runtime/Debugger/DebuggerComponent.TimerInformationWindow.cs b/Runtime/Debugger/DebuggerComponent.TimerInformationWindow.cs index b02d7fb..5fdd115 100644 --- a/Runtime/Debugger/DebuggerComponent.TimerInformationWindow.cs +++ b/Runtime/Debugger/DebuggerComponent.TimerInformationWindow.cs @@ -23,7 +23,7 @@ namespace AlicizaX.Debugger.Runtime public VisualElement Fill; } - private ITimerServiceDebug _mTimerDebug; + private ITimerService _mTimerDebug; private readonly TimerDebugInfo[] m_TimerInfos = new TimerDebugInfo[MAX_DISPLAY_COUNT]; private readonly RowView[] m_TimerRows = new RowView[MAX_DISPLAY_COUNT]; private VisualElement m_ActiveUsageFill; @@ -35,7 +35,7 @@ namespace AlicizaX.Debugger.Runtime public override void Initialize(params object[] args) { - _mTimerDebug = AppServices.Require() as ITimerServiceDebug; + _mTimerDebug = AppServices.Require(); } public override void OnEnter() diff --git a/Runtime/Timer/ITimerService.cs b/Runtime/Timer/ITimerService.cs index 7c495a2..a5b75df 100644 --- a/Runtime/Timer/ITimerService.cs +++ b/Runtime/Timer/ITimerService.cs @@ -1,5 +1,21 @@ using System; +public static class TimerDebugFlags +{ + public const byte Running = 1 << 0; + public const byte Loop = 1 << 1; + public const byte Unscaled = 1 << 2; +} + +public struct TimerDebugInfo +{ + public ulong TimerHandle; + public float LeftTime; + public float Duration; + public float Age; + public byte Flags; +} + namespace AlicizaX.Timer.Runtime { [UnityEngine.Scripting.Preserve] @@ -13,5 +29,11 @@ namespace AlicizaX.Timer.Runtime float GetLeftTime(ulong timerHandle); void Restart(ulong timerHandle); void RemoveTimer(ulong timerHandle); + + int GetAllTimers(TimerDebugInfo[] results); + + void GetStatistics(out int activeCount, out int poolCapacity, out int peakActiveCount, out int freeCount); + + int GetStaleOneShotTimers(TimerDebugInfo[] results); } } diff --git a/Runtime/Timer/ITimerServiceDebug.cs b/Runtime/Timer/ITimerServiceDebug.cs deleted file mode 100644 index b1b50e6..0000000 --- a/Runtime/Timer/ITimerServiceDebug.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace AlicizaX.Timer.Runtime -{ - internal static class TimerDebugFlags - { - public const byte Running = 1 << 0; - public const byte Loop = 1 << 1; - public const byte Unscaled = 1 << 2; - } - - internal struct TimerDebugInfo - { - public ulong TimerHandle; - public float LeftTime; - public float Duration; - public float Age; - public byte Flags; - } - - internal interface ITimerServiceDebug - { - int GetAllTimers(TimerDebugInfo[] results); - - void GetStatistics(out int activeCount, out int poolCapacity, out int peakActiveCount, out int freeCount); - - int GetStaleOneShotTimers(TimerDebugInfo[] results); - } -} diff --git a/Runtime/Timer/ITimerServiceDebug.cs.meta b/Runtime/Timer/ITimerServiceDebug.cs.meta deleted file mode 100644 index 396fbe4..0000000 --- a/Runtime/Timer/ITimerServiceDebug.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5b7cf36ada40b944f8c506e3cd8ddd12 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/Timer/TimerService.cs b/Runtime/Timer/TimerService.cs index e21cf9f..66ab4c1 100644 --- a/Runtime/Timer/TimerService.cs +++ b/Runtime/Timer/TimerService.cs @@ -22,7 +22,7 @@ namespace AlicizaX.Timer.Runtime [UnityEngine.Scripting.Preserve] [Il2CppSetOption(Option.NullChecks, false)] [Il2CppSetOption(Option.ArrayBoundsChecks, false)] - internal sealed class TimerService : ServiceBase, ITimerService, IServiceTickable, ITimerServiceDebug + internal sealed class TimerService : ServiceBase, ITimerService, IServiceTickable { private const int PAGE_SHIFT = 8; private const int PAGE_SIZE = 1 << PAGE_SHIFT; @@ -443,7 +443,7 @@ namespace AlicizaX.Timer.Runtime public int Order => 0; - void ITimerServiceDebug.GetStatistics(out int activeCount, out int poolCapacity, out int peakActiveCount, out int freeCount) + void ITimerService.GetStatistics(out int activeCount, out int poolCapacity, out int peakActiveCount, out int freeCount) { activeCount = _activeCount; poolCapacity = _slotCapacity; @@ -451,7 +451,7 @@ namespace AlicizaX.Timer.Runtime freeCount = _freeCount; } - int ITimerServiceDebug.GetAllTimers(TimerDebugInfo[] results) + int ITimerService.GetAllTimers(TimerDebugInfo[] results) { if (results == null || results.Length == 0) { @@ -470,7 +470,7 @@ namespace AlicizaX.Timer.Runtime return count; } - int ITimerServiceDebug.GetStaleOneShotTimers(TimerDebugInfo[] results) + int ITimerService.GetStaleOneShotTimers(TimerDebugInfo[] results) { if (results == null || results.Length == 0) {