Hi,
I'm trying to build an application that is using 3 local packages to load with the ArcGIS Unity SDK.
In the ArcGISMapComponent I can specify the "source" field for each layer but it seems to only support absolute path. Is there a way to reference a package that could be located inside the Unity "Resources" folder for instance ?
I think I can still configure the map from a C# script and use relative paths there, but I would prefer to have everything configured with the map component if it's possible.
Thankful for any help !
Hi,
once I had a similar problem and got it resolved like that...
1) Create folder StreamingAssets (spelling matters!) on the same level as Scenes, Scripts and the like...
2) Use the following code snippet to access any files in folder StreamingAssets
string somePackageSlpkPath = Path.Combine(Application.streamingAssetsPath, "some_package.slpk");
ArcGIS3DObjectSceneLayer someLayer = new ArcGIS3DObjectSceneLayer(somePackageSlpkPath,
"SomeLayer", 1.0f, true, "");
The trick is to use Application.streamingAssetsPath which tells Unity to look into the StreamingAssets folder. This takes care of packaging any files in there into the build...
Hope this helps...
Best regards
Winfried
Hi,
Your solution is working great for my layers !
Thanks a lot !
Glad to hear that, have fun!