RuntimeInitializeLoadType
の指定による実行順序のメモ
- SubsystemRegistration
- AfterAssembliesLoaded
- BeforeSplashScreen
- BeforeSceneLoad
- AfterSceneLoad
検証コード
public class Initializer
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
public static void AfterSceneLoad()
{
Debug.Log(nameof(AfterSceneLoad));
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void BeforeSceneLoad()
{
Debug.Log(nameof(BeforeSceneLoad));
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
public static void AfterAssembliesLoaded()
{
Debug.Log(nameof(AfterAssembliesLoaded));
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
public static void BeforeSplashScreen()
{
Debug.Log(nameof(BeforeSplashScreen));
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void SubsystemRegistration()
{
Debug.Log(nameof(SubsystemRegistration));
}
}