below is my code:
private void Spawn(int index)
{
AssetReference assetReference = assetReferenceList[index];
if (assetReference.RuntimeKeyIsValid() == false)
{
Debug.Log("Invalid Key " + assetReference.RuntimeKey.ToString());
return;
}
if (_asyncOperationHandles.ContainsKey(assetReference))
{
if (_asyncOperationHandles[assetReference].IsDone)
SpawnAssetFromLoadedReference(assetReference);
else
EnqueueSpawnForAfterInitialization(assetReference);
return;
}
//Addressables.GetDownloadSizeAsync();
LoadAndSpawn(assetReference);
}
private void LoadAndSpawn(AssetReference assetReference)
{
//(below line doesn't work obviously)
assetReference = "https://www.dropbox.com/home/KachinkoAssetsBundles/Android";
var op = Addressables.LoadAssetAsync<GameObject>(assetReference);
_asyncOperationHandles[assetReference] = op;
op.Completed += (operation) =>
{
SpawnAssetFromLoadedReference(assetReference);
if (_queuedSpawnRequests.ContainsKey(assetReference))
{
while (_queuedSpawnRequests[assetReference]?.Any() == true)
{
var position = _queuedSpawnRequests[assetReference].Dequeue();
SpawnAssetFromLoadedReference(assetReference);
}
}
};
}
I have a folder with files in it uploaded to dropbox and am trying to test downloading/updating process. However I haven’t been able to figure out how to convert website address into Asset Reference so that I can call LoadAssetAsync().
How do I download addressable assets that exists in website (drop box in this case) using certain variable value - (website address) - in custom profile?
Thanks in advance.