Addressables-Sample
Addressables-Sample copied to clipboard
SyncAddressables sample doesn't work 2019.4.17f1 with Addressibles 1.16.16
The SyncAddress sample code doesn't work when loading multiple prefabs.
Simple Repro: Change the FixedUp code to load 2 cubes and the exception throws with the load percentage at 0.5
Exception: Sync Instantiate has null result Cube
SyncAddressables.Instantiate (System.Object key, UnityEngine.Transform parent, System.Boolean instantiateInWorldSpace) (at Assets/SyncAddressables/SyncAddressables.cs:120)
spawner.FixedUpdate () (at Assets/spawner.cs:35)
Repro:
if (m_Counter == 10)
{
var go = SyncAddressables.Instantiate("Cube");
go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
m_instances.Add(go);
go = SyncAddressables.Instantiate("Cube");
go.transform.forward = new Vector3(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180));
m_instances.Add(go);
Hi @twhittaker thanks for reporting this! The SyncAddressables project has been removed from the repository. Addressables now supports synchronous loading https://docs.unity3d.com/Packages/[email protected]/manual/SynchronousAddressables.html