Unity - RuntimeInitializeOnLoadMethod: Running Code Before Scene Load
]
Applying this attribute above a function causes it to execute just before the scene is loaded and started.
Since the function information must be known before the scene starts, it must be a static method.
Generally, Awake is sufficient, but if you need to handle device configuration or other setup before the game starts, this is the way to go.
Unity - Scripting API: RuntimeInitializeOnLoadMethodAttribute