Closed neo-mashiro closed 11 months ago
Yeah your point is completely valid, I'll add this coupled with #2, let me know if you have any other suggestions!
Added Init method that is called on creation of the instance or reusing the instance from existing object in the scene from Awake method at e902a9f
The
Awake()
function is the key part to make the derived singleton class persistent across scenes and prevent duplicates, but it is marked asprotected virtual
, so that one could accidentally override it but forgot to add thebase.Awake()
call, which would then break things apart, and it's hard to debug...I think maybe we can improve by doing sth like this?