Where was “void Awake” mentioned before this lecture? I don’t recall using it at all in the previous lectures or sections.
Hello @Simon_Meagher,
Off the top of my head I don’t think it has been, why is that?
Useful link below by the way, has a handy diagram which shows the order of execution for these kind of things.
See also;
- Unity Manual : Execution Order of Event Functions
It is in the code that Ben edits in this lecture. It seems important, but I don’t recall it being brought up before this lecture, nor is it directly addressed about why it suddenly appears.
Honestly I can’t remember. I doubt it is in the first two games, Number Wizard and Text101. It’s possible that it appears in Number Wizard UI.
Easiest way to check would be to either a) open your scripts from the previous sections and see if it appears, or, visit GitHub and search the relevant repositories (for the first 2 or 3 games) for “Awake()”.
As I sure you have realised by now, the Awake()
method is called once, per script, and before any Start()
methods are called.
Updated Tue Jul 18 2017 19:15
I did the hard work for you
Here’s a link:
Block Breaker is the first game in which the Awake()
method is used.
From the README.md file on GitHub;
Execution Order & Singletons
- Introducing Script Execution Order
- Exactly when do scripts get called?
- Debugging & explaining our music glitch
- A simple fix using the Awake() method
Useful Links