call invoke before lateupdate and update unity code example Example: what function is called just before the a script is ended c# OnDisable(){}