mirror of
https://github.com/DCFApixels/Unity-DebugX.git
synced 2025-09-17 17:34:35 +08:00
polishing
This commit is contained in:
parent
94bf266d18
commit
5da2eb16ee
@ -29,7 +29,7 @@ namespace DCFApixels
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private enum PauseStateX
|
private enum DebugXPauseState
|
||||||
{
|
{
|
||||||
Unpaused = 0,
|
Unpaused = 0,
|
||||||
PreUnpaused = 1, //нужно чтобы отщелкунть паузу с задержкой в один тик
|
PreUnpaused = 1, //нужно чтобы отщелкунть паузу с задержкой в один тик
|
||||||
|
@ -22,7 +22,7 @@ namespace DCFApixels
|
|||||||
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
|
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
|
||||||
public static unsafe partial class DebugX
|
public static unsafe partial class DebugX
|
||||||
{
|
{
|
||||||
private static PauseStateX _pauseState = PauseStateX.Unpaused;
|
private static DebugXPauseState _pauseState = DebugXPauseState.Unpaused;
|
||||||
private static bool _isCameraContext = false;
|
private static bool _isCameraContext = false;
|
||||||
|
|
||||||
private static double _lastUnityTime;
|
private static double _lastUnityTime;
|
||||||
@ -31,18 +31,12 @@ namespace DCFApixels
|
|||||||
private static ulong _editorTicks = 0;
|
private static ulong _editorTicks = 0;
|
||||||
private static ulong _lastEditorToRenderTicks = 1000;
|
private static ulong _lastEditorToRenderTicks = 1000;
|
||||||
private static ulong _renderTicks = 100;
|
private static ulong _renderTicks = 100;
|
||||||
//private static ulong _lastEditorToRenderGizmosTicks = 1000;
|
|
||||||
//private static ulong _renderGizmosTicks = 100;
|
|
||||||
private static ulong _timeTicks = 0;
|
private static ulong _timeTicks = 0;
|
||||||
|
|
||||||
public static ulong RenderTicks
|
public static ulong RenderTicks
|
||||||
{
|
{
|
||||||
get { return _renderTicks; }
|
get { return _renderTicks; }
|
||||||
}
|
}
|
||||||
//public static ulong RenderGizmosTicks
|
|
||||||
//{
|
|
||||||
// get { return _renderGizmosTicks; }
|
|
||||||
//}
|
|
||||||
public static ulong TimeTicks
|
public static ulong TimeTicks
|
||||||
{
|
{
|
||||||
get { return _timeTicks; }
|
get { return _timeTicks; }
|
||||||
@ -65,7 +59,7 @@ namespace DCFApixels
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
private static void EditorApplication_pauseStateChanged(PauseState obj)
|
private static void EditorApplication_pauseStateChanged(PauseState obj)
|
||||||
{
|
{
|
||||||
_pauseState = obj == PauseState.Paused ? PauseStateX.Paused : PauseStateX.PreUnpaused;
|
_pauseState = obj == PauseState.Paused ? DebugXPauseState.Paused : DebugXPauseState.PreUnpaused;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endregion
|
#endregion
|
||||||
@ -234,12 +228,10 @@ namespace DCFApixels
|
|||||||
private static void OnPreRender_BRP(Camera camera)
|
private static void OnPreRender_BRP(Camera camera)
|
||||||
{
|
{
|
||||||
PreRender_General(camera);
|
PreRender_General(camera);
|
||||||
//throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
private static void OnPostRender_BRP(Camera camera)
|
private static void OnPostRender_BRP(Camera camera)
|
||||||
{
|
{
|
||||||
PostRender_General(CommandBufferExecutorBRP.GetInstance(), camera);
|
PostRender_General(CommandBufferExecutorBRP.GetInstance(), camera);
|
||||||
//throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PreUpdateCallback()
|
private static void PreUpdateCallback()
|
||||||
@ -250,7 +242,7 @@ namespace DCFApixels
|
|||||||
if (_lastUnityTime < Time.unscaledTimeAsDouble)
|
if (_lastUnityTime < Time.unscaledTimeAsDouble)
|
||||||
{
|
{
|
||||||
_timeTicks++;
|
_timeTicks++;
|
||||||
if (_pauseState == PauseStateX.Unpaused)
|
if (_pauseState == DebugXPauseState.Unpaused)
|
||||||
{
|
{
|
||||||
_deltaTime = Time.unscaledDeltaTime * _timeScaleCache;
|
_deltaTime = Time.unscaledDeltaTime * _timeScaleCache;
|
||||||
}
|
}
|
||||||
@ -269,9 +261,9 @@ namespace DCFApixels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_lastUnityTime = Time.unscaledTimeAsDouble;
|
_lastUnityTime = Time.unscaledTimeAsDouble;
|
||||||
if (_pauseState == PauseStateX.PreUnpaused)
|
if (_pauseState == DebugXPauseState.PreUnpaused)
|
||||||
{
|
{
|
||||||
_pauseState = PauseStateX.Unpaused;
|
_pauseState = DebugXPauseState.Unpaused;
|
||||||
}
|
}
|
||||||
SetGameSceneContext();
|
SetGameSceneContext();
|
||||||
}
|
}
|
||||||
@ -294,7 +286,6 @@ namespace DCFApixels
|
|||||||
_currentCamera = camera;
|
_currentCamera = camera;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void PostRender_General(ICommandBufferExecutor cbExecutor, Camera camera)
|
private static void PostRender_General(ICommandBufferExecutor cbExecutor, Camera camera)
|
||||||
{
|
{
|
||||||
if (_lastEditorToRenderTicks != _editorTicks)
|
if (_lastEditorToRenderTicks != _editorTicks)
|
||||||
@ -542,8 +533,6 @@ namespace DCFApixels
|
|||||||
{
|
{
|
||||||
_buffers[i].Render(cbExecutor);
|
_buffers[i].Render(cbExecutor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//RunEnd();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -559,8 +548,6 @@ namespace DCFApixels
|
|||||||
{
|
{
|
||||||
_buffers[i].PostRender();
|
_buffers[i].PostRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
//RunEnd();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user