Use Invoke methods to execute code at a given time

What if you need to invoke a specific code in 2 seconds? You can write an accumulator that counts time, use coroutine to wait for 2 seconds or simply use Invoke or InvokeRepeating methods. Invoke Invoke is a public method of MonoBehaviour class (so you can access it from your game scripts). It takes method name and time as […]

Read More…

Custom gizmos with OnDrawGizmos

Did you know that by implementing OnDrawGizmos() method in your scripts you can draw a custom gizmo? Last time we talked about how to use icons’ settings to assign various icons to invisible game objects. Yet if you have some experience with scripting then you can create your own gizmos. Basic Example Gizmo drawing can be done using […]

Read More…

Use CustomEditor to customize your script inspector

When your scripts are getting bigger, then usually the number of properties is greater too. Unity, by default, is using the most generic way to display these properties because it does not know the context. You can use decorator attributes but that’s not the only way you can deal with it. In fact, Unity gives you complete freedom to […]

Read More…