I’m getting up to speed with Addressables and one area that I cannot wrap my head around is how to properly define local and remote build paths. I have read the documentation about profiles & path syntax, which refers to a single build target variable and implies there are others, but I can’t find any documentation about what these might be. I also see references in other threads about “defining your own runtime path variables”; how would one go about doing that? Is there a list of implicit build target variables somewhere? Ideally, it would be great to have a few code examples of common-case build path definitions.
To add (though not totally relevant), my use case for addressables (besides memory management) is to import user assets that have been bundled via addressables from a separate project into my game.
I’m a seasoned dev and this problem is making me feel real noobish lol. Any help/context would be greatly appreciated.
I fully agree that this should be better documented. I am trying to figure this stuff out also, but it is documented in a very abstract way, while some examples would be very helpful in this area!
So posting here to bump this topic up!
After posting this, it dawned on me that these abstract path variables can be anything within the Unity API that qualifies a path. So, for paths that are resolved at build time, you can use any path variable within the UnityEditor API. For paths that are resolved at run-time, you can use the UnityEngine API.
For example, I think it’s accurate to say that path fields in the Application class can be used at build time or run-time. See ‘streamingAssetsPath’ or ‘dataPath’ properties:
Keep in mind that .net also has a convenient Path class that could be used to fetch and build paths for the custom-defined variables that get resolved at run-time:
I think the addressables documentation would do well to enumerate on this topic a bit more by pointing to APIs like those above and offering a one or two more examples. I think when trying to wrap one’s head around profiles, schemas, asset groups, catalogues, local vs remote bundles, etc, it’s easy to miss what seems obvious in retrospect haha. Especially so when one doesn’t do a ton of path qualification in their day to day coding work.
In any case, hope this helps. If I can help clarify anything, let me know.
1 Like