P
P
Pragma Games2021-10-07 14:05:15
Unity
Pragma Games, 2021-10-07 14:05:15

Is it possible to unsubscribe from Update?

Question out of pure curiosity. Update is an event, so you can unsubscribe from it if the need arises ? And if so, what would be the consequences.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Boronnikov, 2021-10-11
@PragmaGames

Update is not an event. This is the method. "Unsubscribe" is not possible.
A large number of Updates in monobehs cause additional load, so on large projects they make separate Systems in which there is 1 Update , which pulls its custom event and separate monobehs already subscribe to this event. And there you can subscribe / unsubscribe as much as you like. Moreover, here it will be possible to gain control over time without being tied to a static Time . So on one of the projects they did a smooth time dilation without slowing down the player and UI.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question