c#

Coroutines in Unity3D

Objective : The objective of this blog is to learn about Coroutines and its uses in Unity3D. Introduction : Before jumping to Coroutines, let’s discuss why it is required ? and what makes it a powerful feature that can do wonder in unity. Unity is frame based.Unity does things each frame. Many processes in games take place over the course of multiple frames.Sometimes we got a dense process that takes a long time to finish, so during this time your game will run at low FPS(frames per second). so we have to find a way so that this process will not impact our game fps. One way is run this process on another thread, instead on the main thread. But Unity is single threaded. There is one main loop of Unity and all those functions that you write are being called by the same main thread in order. we can verify…