2025-02-22 17:25:54 +08:00
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using UnityEngine;
|
2025-02-24 18:18:49 +08:00
|
|
|
|
using UnityEngine.Rendering;
|
2025-02-22 17:25:54 +08:00
|
|
|
|
|
|
|
|
|
namespace DCFApixels
|
|
|
|
|
{
|
2025-02-24 18:18:49 +08:00
|
|
|
|
public static class DebugXConsts
|
|
|
|
|
{
|
|
|
|
|
public const float IMMEDIATE_DURATION = -1;
|
|
|
|
|
public const float DOT_SIZE = 0.05f;
|
|
|
|
|
|
|
|
|
|
public readonly static bool IsSRP = GraphicsSettings.currentRenderPipeline != null;
|
|
|
|
|
public readonly static bool IsSupportsComputeShaders = SystemInfo.supportsComputeShaders;
|
|
|
|
|
}
|
2025-02-22 17:25:54 +08:00
|
|
|
|
public static partial class DebugX
|
|
|
|
|
{
|
|
|
|
|
internal const MethodImplOptions LINE = MethodImplOptions.AggressiveInlining;
|
|
|
|
|
|
2025-02-23 20:03:13 +08:00
|
|
|
|
private const float DEFAULT_DURATION = 0f;
|
|
|
|
|
private static readonly Color DEFAULT_COLOR = Color.white;
|
2025-02-22 17:25:54 +08:00
|
|
|
|
|
2025-02-24 17:59:44 +08:00
|
|
|
|
private const string GLOBAL_TIME_SCALE_PREF_NAME = "DCFApixels.DebugX.TimeScale";
|
|
|
|
|
private const string GLOBAL_DOT_SIZE_PREF_NAME = "DCFApixels.DebugX.DotSize";
|
|
|
|
|
private const string GLOBAL_COLOR_PREF_NAME = "DCFApixels.DebugX.Color";
|
2025-02-22 17:25:54 +08:00
|
|
|
|
|
2025-02-24 17:59:44 +08:00
|
|
|
|
private readonly static int GlobalDotSizePropertyID = Shader.PropertyToID("_DebugX_GlobalDotSize");
|
|
|
|
|
private readonly static int GlobalColorPropertyID = Shader.PropertyToID("_DebugX_GlobalColor");
|
|
|
|
|
internal readonly static int ColorPropertyID = Shader.PropertyToID("_Color");
|
2025-02-22 17:25:54 +08:00
|
|
|
|
|
2025-02-24 17:59:44 +08:00
|
|
|
|
|
|
|
|
|
|
2025-02-28 10:19:44 +08:00
|
|
|
|
private enum DebugXPauseState
|
2025-02-24 13:16:30 +08:00
|
|
|
|
{
|
|
|
|
|
Unpaused = 0,
|
|
|
|
|
PreUnpaused = 1, //нужно чтобы отщелкунть паузу с задержкой в один тик
|
|
|
|
|
Paused = 2,
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-02-22 17:25:54 +08:00
|
|
|
|
public enum DebugXLine
|
|
|
|
|
{
|
|
|
|
|
Default,
|
|
|
|
|
Arrow,
|
|
|
|
|
Fade,
|
|
|
|
|
}
|
2025-02-24 18:18:49 +08:00
|
|
|
|
}
|
|
|
|
|
namespace DCFApixels.DebugXCore
|
|
|
|
|
{
|
|
|
|
|
public static class DebugXDefines
|
|
|
|
|
{
|
2025-03-12 21:49:38 +08:00
|
|
|
|
public const bool DEBUGX_DISABLE_INBUILD =
|
2025-03-12 22:33:58 +08:00
|
|
|
|
#if DEBUGX_DISABLE_INBUILD
|
2025-03-12 21:49:38 +08:00
|
|
|
|
true;
|
|
|
|
|
#else
|
|
|
|
|
false;
|
|
|
|
|
#endif
|
|
|
|
|
public const bool DEBUGX_ENABLE_PHYSICS2D =
|
2025-03-12 22:33:58 +08:00
|
|
|
|
#if DEBUGX_ENABLE_PHYSICS2D
|
2025-03-12 21:49:38 +08:00
|
|
|
|
true;
|
|
|
|
|
#else
|
|
|
|
|
false;
|
|
|
|
|
#endif
|
|
|
|
|
public const bool DEBUGX_ENABLE_PHYSICS3D =
|
2025-03-12 22:33:58 +08:00
|
|
|
|
#if DEBUGX_ENABLE_PHYSICS3D
|
2025-02-24 18:18:49 +08:00
|
|
|
|
true;
|
|
|
|
|
#else
|
|
|
|
|
false;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2025-02-22 17:25:54 +08:00
|
|
|
|
}
|