mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-12 23:37:07 +00:00
clear progress bar when loading finishes
This commit is contained in:
parent
e6e8420f44
commit
51eb669178
2 changed files with 14 additions and 0 deletions
|
@ -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" );
|
||||
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue