Ever wonder how the magic
events of unity Behavior work:
void Awake()
{
}
void Start()
{
}
void Update()
{
}
// Or other unity magic events like OnEnable, OnDisable, Late Update, Fixed Update, etc.,
Steps to call Unity Magic Events:
The way Messaging system or magic events are works in unity3dis:
1. Unity
scripting runtime Mono or IL2CPP access MonoBehaviour derived
(type) script.
2. Look
for magic events and cache them.
3. Like
if a MonoBehaviour derived
script has an update event then, the script will be added into a list (list of
scripts) that will be updated on every frame.
4. Now
during gameplay, unity iterates over the list and Trigger the Unity events. This is
the reason that if you make your event public or private they don’t get
affected.
Hope that this post will clarify how smartly unity calls its built-in events.
Read More: Coding Forums for Developers
0 Comments