Skip to content
Published May 10, 2021

https://docs.unity3d.com/ScriptReference/RuntimeInitializeOnLoadMethodAttribute-ctor.html

I have a bootstrap script that I picked up from Jason Weimann which makes sure that input is initialized before the awake method. Craft this timing using this attribute [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void Initialize()
{//stuff}

This means you can write initialization code without having the class be a MonoBehavior.

Share

Comments are closed.

Share