Contains various static methods relating to debugging and diagnostics.
More...
|
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...
|
|
Contains various static methods relating to debugging and diagnostics.
◆ 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
-
propertySet | Whether the caller is a property set accessor (changes error log). |
callerName | Set 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
-
cmp | Component to attach the Coroutine to. |
frames | Number 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
-
bounds | Bounds to draw. |
color | Color to use. |
duration | Time, in seconds, to draw the lines for. |
depthTest | Whether 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
-
point | Center of the circle. |
normal | Normal that is perpendicular to the circle. |
radius | Radius of the circle. |
color | Color to use. |
duration | Time, in seconds, to draw the circle for. |
depthTest | Whether to depth dest the drawn circle. |
pointCount | How 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
-
center | Center of the sphere. |
radius | Radius of the sphere. |
color | Color to use. |
duration | Time, in seconds, to draw the sphere for. |
depthTest | Whether to depth dest the drawn sphere. |
pointCount | How many points each circle will consist of. |
The documentation for this class was generated from the following file:
- Runtime/Utility/DebugUtility.cs