Is it common to use Awake() for delegate setting?


I simply wonder if it’s correct, and common to use the Awake method in order to set up some delegates.

I use a lot of delegates in my game but it happens that one of them is called after another one. So to prevent this I set up the delegate in the Awake method in order to be sure that it will be called before all others.

Is it correct to do that?

You may want to consider adding them to OnEnable instead of Awake, for cleanup sake. Subscribe in OnEnable, unsub in OnDisable.

Scripts get called like so:

Awake → OnEnable → Start, and so on, so it’s safe for you to place in OnEnable for your ordering.

And as far as the practice, I believe it’s perfectly fine, but I would recommend doing so as I suggested instead of Awake.