Debug.Log Extensions
Documentation (1.1.9)

◆ Assert() [9/11]

static void Debug.Assert ( bool  condition,
[NotNull] Expression< Action >  methodContext 
)
static

Logs an error message to the Console if condition is not true.

Calls to this method will be stripped from release builds unless the UNITY_ASSERTIONS symbol is defined.

public void DestroyAll(params Object[] targets)
{
Debug.Assert(targets != null, ()=>Destroy(targets));
foreach(var target in targets)
{
Debug.Assert(target != null, ()=>Destroy(targets));
Destroy(target);
}
}
static void Assert(bool condition, int channel, Object context=null)
Logs an error message to the Console if condition is not true.
Definition: Debug.cs:3381
Extended version of the built-in Debug class with additional methods to ease debugging while developi...
Definition: Debug.cs:34
Parameters
conditionCondition you expect to be true.
methodContextExpression pointing to a method to which the assertion applies.