Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ ThrowIfNull< TObject >()

static void Sisus.NullExtensions.ThrowIfNull< TObject > ( TObject reference,
string exceptionMessage )
static

Throws an ArgumentNullException if reference is null or a destroyed Object.

This method will only execute in the editor and in development builds; all calls made to this method will be completely stripped out of release builds.

Template Parameters
TObjectType of the object to check.
Parameters
referenceObject to guard against being null.
exceptionMessageException message to show in the Console if reference is null.

If the message contains "{0}" then that will be replaced with the name of the TObject type.

Exceptions
ArgumentNullExceptionThrown if reference is null or a destroyed Object.