Hi guys this is my first time using addressables so I might miss something obvious here.
So I’m trying to check if my local cache assets are up to date by calling
Addressables.CheckForCatalogUpdates() but it seems like to always return Succeeded even if there’s not internet connection. I can’t differentiate whether it already checks from the cloud and there’s no update with it tried to connect but fail since there’s no error at all. I also tried Addressables.GetDownloadSizeAsync but same thing it always return status succeded even without syncing with the cloud asset. Is there anyway to check if my local cache is up to date with the one in the remote server?
this is my code
public void CheckForUpdate()
{
Addressables.CheckForCatalogUpdates().Completed += (_updates) =>
{
if (_updates.Status == AsyncOperationStatus.Failed)
{
Debug.LogWarning("Fetch failed!");
}
if (_updates.Result.Count > 0)
{
Debug.Log("Available Update:");
foreach (var update in _updates.Result)
{
Debug.Log(update);
}
// proceed with downloading new content
}
else
{
Debug.LogError("No Available Update");
// proceed with loading from cache
}
};
}
public void Confirmation()
{
Addressables.GetDownloadSizeAsync("default").Completed += (x) =>
{
print( x.Result.ToString());
if(x.Result > 0 && x.Status == AsyncOperationStatus.Succeeded)
{
var totalSize = new ByteSize((double)x.Result);
confirmationWindow.SetActive(true);
confirmationText.text = confirmationText.text.Replace("[size]", totalSize.ToString());
print(totalSize.ToString());
}
else downloadCompleteWindow.SetActive(true);
};
}