@@ -36,11 +36,14 @@ ARKit can track meshes that are defined in the .arobject format. Such an object
Unity serializes .arobject into ARKitReferenceObjectEntry in the editor. ARKitReferenceObjectEntry cannot then be imported at runtime from a .arobjject file. Dynamic loading is not supported yet.
To support adding .arobject without recompiling the full application, we use a dedicated AssetBundle (named "arfmeshes"). To do so:
To support adding .arobject without recompiling the full application, we use a dedicated AssetBundle.
* Place you .arobject in the Assets Folder. For instance under Assets/ARObjects
* Associate the ARKitReferenceObjectEntry with the arfmeshes AssetBundle in the editor
* Build the AssetBundles. For that you can use the following menu: ARF--> Build AssetBundles iOS
* Pace the "arfmeshes" file in the Unity persistent data path of the application on the user device.
Then you have two options:
* Placing the AssetBundle "arfmeshes" file (with this exact file name) in the Unity persistent data path of the application on the user device.
* The variable keyvalueTags of the Trackable can also contain a parameter with the "url" key providing a link to download the AssetBundle to the Unity persistent data path on the user device. Only one AssetBundle can be loaded.
The name of the Trackable in the World Storage must correspond to the name of the ARKitReferenceObjectEntry.
KeyValuePair<string,string>download=System.Threading.Tasks.Task.Run(()=>WorldAnalysisARFoundationHelper.DownloadFileHTTP(url)).Result;// synchronous : not perfect at all prevent to add another mesh while bundle is downloading