Unity-Technologies / Addressables-Sample

Demo project using Addressables package
1.32k stars 299 forks source link

WaitForCompletion() not working? #76

Open ahmetteksas opened 2 years ago

ahmetteksas commented 2 years ago

`[ServerRpc] private void ServerSpawnPlayer() { GameObject playerPrefab = Addressables.LoadAssetAsync("Player").WaitForCompletion();

    GameObject playerInstance = Instantiate(playerPrefab);

    Spawn(playerInstance, Owner);
}`

why is this line red? "Addressables.LoadAssetAsync("Player")"

please do not suggest me the link below because ı wrote same thing on the linked example, everything is the same, nothing changes !. I use 2021.1.6f1 version. Please fix the bug as soon as possible.

https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/SynchronousAddressables.html#api

rafaeldolfe commented 1 year ago

As far as I understand, the version of Addressables used in this sample project is not updated to the latest Addressables version. Therefore, it simply doesn't have the WaitForCompletion method available. I tried updating the Addressables version to the latest, and my editor picked up the WaitForCompletion method on the handle.

(This comes with other issues though, I got seemingly unfixable Library compile errors as a consequence)