1
\$\begingroup\$

Does Debug.LogAssert(expression) gets deleted in Unity once I build the game?

I was not able to find it here. I feel like it should get deleted, but still I can not assure myself in it (no reliable source was found by me).

So, I would be grateful for the source provided which would assure me in it or point me out, that it is not the case.

\$\endgroup\$
  • \$\begingroup\$ Just try it out? \$\endgroup\$ – Tyyppi_77 Apr 27 '18 at 11:14
0
\$\begingroup\$

Yes, Debug.Assert gets removed from non-development builds by default. It's possible to change this setting - see the Unity documentation on BuildOptions.ForceEnableAssertions:

BuildOptions.ForceEnableAssertions

Include assertions in the build. By default, the assertions are only included in development builds.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.