Debug.Log Extensions
Documentation (1.1.9)

◆ Assert() [10/11]

static void Debug.Assert ( [CanBeNull] object  expectedValue,
[NotNull] Expression< Func< object >>  classMember 
)
static

Logs an error message to the Console if classMember value does not match expectedValue .

Note that this method work only if UNITY_ASSERTIONS symbol is defined, like for example in development builds.

int variable = 5;
variable += 10;
Debug.Assert(15, ()=>variable);
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
expectedValueValue you expect the class member to have.
classMemberExpression pointing to the class member with the expected value.