Build a Reusable Timer in Unity to Control Explosions (and other fun stuff too…)

Build a Reusable Timer in Unity to Control Explosions (and other fun stuff too…)

5 years ago
Anonymous $Dftgs0JzgE

https://medium.com/@jaredehalpern/build-a-reusable-timer-in-unity-to-control-explosions-and-other-fun-stuff-too-1689210b733

Jared HalpernBlockedUnblockFollowFollowingMar 31What We’re BuildingIn this post, we’re going to learn how to build a Timer that does something when the time elapses. The mechanism to do something will be customizable and generic enough so that you can use it to programmatically execute basically anything you can script. In the example we build, we will script the explosion animation to appear and play when the time runs out. We’ll build this Timer as a standalone script which can be attached to any GameObject in Unity and reused. You’ll also learn a bit about Coroutines and Interfaces too.

• Familiarity with C# variables, classes, methods, the Unity Editor, GameObjects, Prefabs