Bootstrap initialization order figured out and provided events + dispatchers
This commit is contained in:
@@ -94,6 +94,19 @@ namespace Bootstrap
|
||||
CurrentProgress = 1f;
|
||||
OnBootProgressChanged?.Invoke(1f);
|
||||
OnBootCompleted?.Invoke();
|
||||
|
||||
// Notify the BootCompletionService that boot is complete
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// We use reflection to avoid direct reference in case the service is disabled/removed
|
||||
var type = System.Type.GetType("Bootstrap.BootCompletionService, Assembly-CSharp");
|
||||
if (type != null)
|
||||
{
|
||||
var method = type.GetMethod("HandleBootCompleted",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
method?.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,6 +119,19 @@ namespace Bootstrap
|
||||
CurrentProgress = 1f;
|
||||
OnBootProgressChanged?.Invoke(1f);
|
||||
OnBootCompleted?.Invoke();
|
||||
|
||||
// Notify the BootCompletionService that boot is complete
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// We use reflection to avoid direct reference in case the service is disabled/removed
|
||||
var type = System.Type.GetType("Bootstrap.BootCompletionService, Assembly-CSharp");
|
||||
if (type != null)
|
||||
{
|
||||
var method = type.GetMethod("HandleBootCompleted",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
method?.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user