- Home /
Question by
unitylepi · Oct 09, 2019 at 08:36 AM ·
newbieawakeinitialization
Initialization before Awake possible?
I would like to initialize a game-wide file logger before any of the game's components make use of it. This logger needs to remove any previous log files. Currently I initialize the logger in the Awake method of a game object, but this means that no other object may log during their Awake call (as their data might be wiped). Is there something like a game-wide Awake() that is called before any of the objects wake up in which I can do this?
Comment
Best Answer
Answer by cdr9042 · Oct 09, 2019 at 08:50 AM
you can try
Tweak Script Execution Order: make the logger script have higher priority https://docs.unity3d.com/Manual/class-MonoManager.html
Make a preload scene that initialize the logger, then load the main game scene