Scripting tips

The following tips are useful features to know when scripting.

General

We can modify various templates of new Script, Shader, and Compute Shader files. This can be helpful to remove the empty Update stubs which, as we learned, can cause unnecessary runtime overhead. These files can be found in the following locations:

  • Windows: <Unity install>\Editor\Data\Resources\ScriptTemplates\
  • OSX: /Applications/Unity/Editor/Data/Resources/ScriptTemplates/

The recent release of Unity Version 5.1 introduced the Assert class and allows for assert-based debugging, which some developers are more comfortable with as opposed to exception-based debugging. Check the Unity documentation for more information on Asserts: http://docs.unity3d.com/ScriptReference/Assertions.Assert.html ...

Get Unity 5 Game Optimization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.