- Home /
How is calling a function from a button click handled internally?
Hey guys, i know the main-thread in unity runs through the life cycle of unity.
if i have programmed something in the update function this code will be exectued every frame. if i create a button and configure the button to call a specified function when pressed how does this work with the life cycle?
is it like an interrupt where the code execution in the update stops when the button is pressed, then the specified function gets called and after the function is done the code in the update function is executed from where it jumped out?
or how does it work?
Answer by Didux · Sep 17, 2020 at 10:05 AM
Hi @JulianBieden122 ,
You can find here the order of execution for event functions : https://docs.unity3d.com/Manual/ExecutionOrder.html
Maybe that could help you.
There is not much info about unity events in there, i generally think it's handled a bit like a coroutine.