Instantiate and Unity's new Addressable Asset system ?

IIRC, Photon.Instantiate requires a prefab to be located in a Resource folder and is called using the name.

Unity's new Addressable Asset system (https://docs.unity3d.com/Packages/com.unity.addressables@0.2/manual/AddressableAssetsGettingStarted.html)
allows retrieval of prefabs from sources both internal and external. For webgl, the prefabs will live on a server and retrieved via the Addressable Asset system.

Given those two methodologies, how would you propose instantiating a networked object that was retrieved externally as an addressable asset?

Thanks!

Comments

  • @Tobias @JohnTube do you guys have or are you working on a solution for handling instantiation with Unity's addressable assets system?

    Sorry for the bump, but am half way through a sprint xD

    Thanks!
  • The new Addressable Assets system is something we didn't check out in depth yet.

    With PUN 2, you should be able to make use of Addressables, as it now uses a "Pool" to load the prefab/GameObject to instantiate.
    Afaik, Addressables are loaded async, which is tricky when PUN expects an object right within Instantiate. You could either load the Addressables beforehand (and cache them) or you could pass a "proxy", I guess and later replace it when the loaded asset becomes available.
    You would have to organize this somehow, as assets are not immediately available/final. However, this is the basis for Addressables anyways, more or less.