clear progress bar when loading finishes

This commit is contained in:
in0finite 2022-01-21 02:01:35 +01:00
parent e6e8420f44
commit 51eb669178
2 changed files with 14 additions and 0 deletions

View file

@ -71,6 +71,8 @@ namespace SanAndreasUnity.Behaviours
public static event System.Action onLoadSpecialTextures = delegate { };
public static event System.Action onLoadingFinished = delegate { };
protected override void OnSingletonStart()
@ -149,6 +151,8 @@ namespace SanAndreasUnity.Behaviours
if (s_coroutine != null)
CoroutineManager.Stop(s_coroutine);
s_coroutine = null;
F.InvokeEventExceptionSafe(onLoadingFinished);
}
@ -237,6 +241,8 @@ namespace SanAndreasUnity.Behaviours
Debug.Log("GTA loading finished in " + stopwatch.Elapsed.TotalSeconds + " seconds");
F.InvokeEventExceptionSafe(onLoadingFinished);
// notify all scripts
F.SendMessageToObjectsOfType<MonoBehaviour>( "OnLoaderFinished" );

View file

@ -14,6 +14,9 @@ namespace SanAndreasUnity.Editor
{
EditorApplication.update -= EditorUpdate;
EditorApplication.update += EditorUpdate;
Loader.onLoadingFinished -= OnLoadingFinished;
Loader.onLoadingFinished += OnLoadingFinished;
}
static void EditorUpdate()
@ -32,6 +35,11 @@ namespace SanAndreasUnity.Editor
}
}
static void OnLoadingFinished()
{
EditorUtility.ClearProgressBar();
}
[MenuItem(EditorCore.MenuName + "/" + "Load game data")]
static void MenuItemLoadGameData()
{