Infohazard.Core 1.4.1
Infohazard Core Utility Library
Loading...
Searching...
No Matches
Infohazard.Core.DebugUtility Class Reference

Contains various static methods relating to debugging and diagnostics. More...

Static Public Member Functions

static void DrawDebugBounds (Bounds bounds, Color color, float duration=0.0f, bool depthTest=true)
 Draw the given Bounds in the scene view. More...
 
static void DrawDebugCircle (Vector3 point, Vector3 normal, float radius, Color color, float duration=0.0f, bool depthTest=true, int pointCount=32)
 Draw the given circle in the scene view. More...
 
static void DrawDebugSphere (Vector3 center, float radius, Color color, float duration=0.0f, bool depthTest=true, int pointCount=32)
 Draw the given sphere in the scene view. More...
 
static void DebugBreakAfterFrames (this MonoBehaviour cmp, int frames)
 Pause the editor after a given number of frames, using a Coroutine and Debug.Break(). More...
 
static bool CheckPlaying (bool propertySet=false, [CallerMemberName] string callerName="")
 Checks whether in play mode (including standalone), and prints an error if it is. More...
 

Detailed Description

Contains various static methods relating to debugging and diagnostics.

Member Function Documentation

◆ CheckPlaying()

static bool Infohazard.Core.DebugUtility.CheckPlaying ( bool  propertySet = false,
[CallerMemberName] string  callerName = "" 
)
static

Checks whether in play mode (including standalone), and prints an error if it is.

Used to ensure certain properties are not edited while playing.

Parameters
propertySetWhether the caller is a property set accessor (changes error log).
callerNameSet automatically, do not supply a value for this parameter.
Returns
True if in play mode.

◆ DebugBreakAfterFrames()

static void Infohazard.Core.DebugUtility.DebugBreakAfterFrames ( this MonoBehaviour  cmp,
int  frames 
)
static

Pause the editor after a given number of frames, using a Coroutine and Debug.Break().

Only works in play mode. Will not cause errors if used in a standalone build, but will do unnecessary work.

Parameters
cmpComponent to attach the Coroutine to.
framesNumber of frames to wait before pausing.

◆ DrawDebugBounds()

static void Infohazard.Core.DebugUtility.DrawDebugBounds ( Bounds  bounds,
Color  color,
float  duration = 0.0f,
bool  depthTest = true 
)
static

Draw the given Bounds in the scene view.

Parameters
boundsBounds to draw.
colorColor to use.
durationTime, in seconds, to draw the lines for.
depthTestWhether to depth dest the drawn lines.

◆ DrawDebugCircle()

static void Infohazard.Core.DebugUtility.DrawDebugCircle ( Vector3  point,
Vector3  normal,
float  radius,
Color  color,
float  duration = 0.0f,
bool  depthTest = true,
int  pointCount = 32 
)
static

Draw the given circle in the scene view.

Parameters
pointCenter of the circle.
normalNormal that is perpendicular to the circle.
radiusRadius of the circle.
colorColor to use.
durationTime, in seconds, to draw the circle for.
depthTestWhether to depth dest the drawn circle.
pointCountHow many points the circle will consist of.

◆ DrawDebugSphere()

static void Infohazard.Core.DebugUtility.DrawDebugSphere ( Vector3  center,
float  radius,
Color  color,
float  duration = 0.0f,
bool  depthTest = true,
int  pointCount = 32 
)
static

Draw the given sphere in the scene view.

Parameters
centerCenter of the sphere.
radiusRadius of the sphere.
colorColor to use.
durationTime, in seconds, to draw the sphere for.
depthTestWhether to depth dest the drawn sphere.
pointCountHow many points each circle will consist of.

The documentation for this class was generated from the following file: