mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 14:27:37 +02:00
Asset Loading Fix (#843)
* (hopefullyt) fix asset loading issue * let mis-packed games load from res timing display tweak * fix initial pre-load not actually preloading needed games fix mr upbeat metronome * let's try this resyncing again
This commit is contained in:
@ -386,8 +386,10 @@ namespace HeavenStudio
|
||||
|
||||
public bool usesAssetBundle => wantAssetBundle is not null or "";
|
||||
public bool hasLocales => supportedLocales.Count > 0;
|
||||
public bool AssetsLoaded => ((hasLocales && localeLoaded && currentLoadedLocale == defaultLocale) || (!hasLocales)) && commonLoaded && loadComplete;
|
||||
public bool AssetsLoaded => ((hasLocales && localeLoaded && currentLoadedLocale == defaultLocale) || (!hasLocales)) && commonLoaded && (!loadingPrefab) && loadComplete;
|
||||
public bool AlreadyLoading => alreadyLoading;
|
||||
public bool LoadingPrefab => loadingPrefab;
|
||||
|
||||
public bool SequencesPreloaded => soundSequences != null;
|
||||
public string LoadableName => inferred ? "noGame" : name;
|
||||
public GameObject LoadedPrefab => loadedPrefab;
|
||||
@ -401,6 +403,7 @@ namespace HeavenStudio
|
||||
private bool localePreloaded = false;
|
||||
private GameObject loadedPrefab = null;
|
||||
|
||||
bool loadingPrefab = false;
|
||||
bool loadComplete = false;
|
||||
|
||||
private SoundSequence.SequenceKeyValue[] soundSequences = null;
|
||||
@ -497,6 +500,7 @@ namespace HeavenStudio
|
||||
if (alreadyLoading || AssetsLoaded || !usesAssetBundle) return;
|
||||
loadComplete = false;
|
||||
alreadyLoading = true;
|
||||
loadingPrefab = true;
|
||||
await UniTask.WhenAll(LoadCommonAssetBundleAsync(), LoadLocalizedAssetBundleAsync());
|
||||
await UniTask.WhenAll(LoadGamePrefabAsync(), LoadCommonAudioClips(), LoadLocalizedAudioClips());
|
||||
SoundByte.PreloadGameAudioClips(this);
|
||||
@ -572,6 +576,7 @@ namespace HeavenStudio
|
||||
soundSequences = minigame.SoundSequences;
|
||||
}
|
||||
loadedPrefab = prefab;
|
||||
loadingPrefab = false;
|
||||
}
|
||||
|
||||
public GameObject LoadGamePrefab()
|
||||
@ -623,6 +628,7 @@ namespace HeavenStudio
|
||||
}
|
||||
SoundByte.UnloadAudioClips(name);
|
||||
loadComplete = false;
|
||||
loadingPrefab = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user