polishing

This commit is contained in:
DCFApixels 2025-02-28 10:19:44 +08:00
parent 94bf266d18
commit 5da2eb16ee
2 changed files with 6 additions and 19 deletions

View File

@ -29,7 +29,7 @@ namespace DCFApixels
private enum PauseStateX
private enum DebugXPauseState
{
Unpaused = 0,
PreUnpaused = 1, //нужно чтобы отщелкунть паузу с задержкой в один тик

View File

@ -22,7 +22,7 @@ namespace DCFApixels
using IN = System.Runtime.CompilerServices.MethodImplAttribute;
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 double _lastUnityTime;
@ -31,18 +31,12 @@ namespace DCFApixels
private static ulong _editorTicks = 0;
private static ulong _lastEditorToRenderTicks = 1000;
private static ulong _renderTicks = 100;
//private static ulong _lastEditorToRenderGizmosTicks = 1000;
//private static ulong _renderGizmosTicks = 100;
private static ulong _timeTicks = 0;
public static ulong RenderTicks
{
get { return _renderTicks; }
}
//public static ulong RenderGizmosTicks
//{
// get { return _renderGizmosTicks; }
//}
public static ulong TimeTicks
{
get { return _timeTicks; }
@ -65,7 +59,7 @@ namespace DCFApixels
#if UNITY_EDITOR
private static void EditorApplication_pauseStateChanged(PauseState obj)
{
_pauseState = obj == PauseState.Paused ? PauseStateX.Paused : PauseStateX.PreUnpaused;
_pauseState = obj == PauseState.Paused ? DebugXPauseState.Paused : DebugXPauseState.PreUnpaused;
}
#endif
#endregion
@ -234,12 +228,10 @@ namespace DCFApixels
private static void OnPreRender_BRP(Camera camera)
{
PreRender_General(camera);
//throw new NotImplementedException();
}
private static void OnPostRender_BRP(Camera camera)
{
PostRender_General(CommandBufferExecutorBRP.GetInstance(), camera);
//throw new NotImplementedException();
}
private static void PreUpdateCallback()
@ -250,7 +242,7 @@ namespace DCFApixels
if (_lastUnityTime < Time.unscaledTimeAsDouble)
{
_timeTicks++;
if (_pauseState == PauseStateX.Unpaused)
if (_pauseState == DebugXPauseState.Unpaused)
{
_deltaTime = Time.unscaledDeltaTime * _timeScaleCache;
}
@ -269,9 +261,9 @@ namespace DCFApixels
}
}
_lastUnityTime = Time.unscaledTimeAsDouble;
if (_pauseState == PauseStateX.PreUnpaused)
if (_pauseState == DebugXPauseState.PreUnpaused)
{
_pauseState = PauseStateX.Unpaused;
_pauseState = DebugXPauseState.Unpaused;
}
SetGameSceneContext();
}
@ -294,7 +286,6 @@ namespace DCFApixels
_currentCamera = camera;
}
private static void PostRender_General(ICommandBufferExecutor cbExecutor, Camera camera)
{
if (_lastEditorToRenderTicks != _editorTicks)
@ -542,8 +533,6 @@ namespace DCFApixels
{
_buffers[i].Render(cbExecutor);
}
//RunEnd();
}
}
@ -559,8 +548,6 @@ namespace DCFApixels
{
_buffers[i].PostRender();
}
//RunEnd();
}
}