Hey @unity_bill ,
I am using addressable system in my game.
I download the content in splash scene before my game scene is loaded.
The problem is if you lose connection during the content download phase
The addressable system is not able to download the remaining content once connection is back to normal IN THE SAME SESSION.
If I close my app and relaunch it. Then it works like a charm.
I tried to force initialize Addressable to make it work in same game session
Here is the modified initializeAsync in AddresableImpl.cs
public AsyncOperationHandle<IResourceLocator> InitializeAsync(bool force = false)
{
if(force)
{
LogError("***FORCE ReInitializing Addressable System***:" + force);
return InitializeAsync(ResolveInternalId(PlayerPrefs.GetString(Addressables.kAddressablesRuntimeDataPath, RuntimePath + "/settings.json")));
}
if (!m_InitializationOperation.IsValid())
{
return InitializeAsync(ResolveInternalId(PlayerPrefs.GetString(Addressables.kAddressablesRuntimeDataPath, RuntimePath + "/settings.json")));
}
return m_InitializationOperation;
}
but no luck.
Here is how I am trying to downloading assets.
public static void InitializeAddresable(bool force = false)
{
Debug.LogError("InitializeAddresable : " + force);
InitializationOperation = Addressables.InitializeAsync(force);
}
public static void DownloadFolders(List<string> keys, Action onComplete)
{
List<object> folders = new List<object>(keys);
CurrentDownloadOperation = Addressables.DownloadDependenciesAsync(folders, Addressables.MergeMode.Union);
CurrentDownloadOperation.Completed += (AsyncOperationHandle asyncOperation) => {
Debug.LogError(" Download Folders Complete ");
if (onComplete != null)
{
onComplete();
}
};
}
I am using Addressables package Version 1.2.3
Is there anything that I am missing?