|
Debug.Log Extensions
Documentation (1.1.9)
|
|
static |
If condition is false throws an exception of type TException .
If condition is true does nothing.
This can be useful for checking that the arguments passed to a function are valid and if not terminating the process with an error.
Note that an exception will be thrown every time that this method is called and condition evaluates to false. This is in contrast to some of the other Guard methods that only log an error once per session.
Calls to this method will be fully stripped from release builds. If you don't want this behaviour you can use Debug.Guard<TException>(bool, object[]) or Critical.Guard<TException>(bool, object[]) instead.
| condition | Condition you expect to be true. |
| exceptionArguments | Optional arguments to pass to the TException constructor when an exception is thrown. |
Most exception constructors accept a string argument specifying the message to be logged to the Console. For ArgumentNullException on the other hand a single string argument specifies the name of the parameter that was null.
| TException | : | Exception | |
| TException | : | new() |