The sceriano is when I destroy a game object, or set active true, instantiate,… Normally I need to wait 1 frame for the action actually executed or else will be a null
, or can’t find it by FindGameObject
.
My current solution is put all the code inside coroutine with a simple yield return null
to wait for 1 frame.
I want to ask if there are any better solutions?