Addressable asset referencing within addressable scenes

Hi,

We have a scene that is marked as addressable and loaded asynchronously through script in a manner similar to this tutorial: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

Inside the addressable scene is a mesh renderer. That mesh renderer references a material. The material has two variants, MatPC.mat and MatMobile.mat. Both of these materials are addressable and are accessed by the same addressable address (Mat.mat). We have 3 addressables groups - Default, PC and Mobile. The scene is in the Default group, MatPC.mat is in the PC group and MatMobile.mat is in the Mobile group.

In the editor, the default reference in the mesh renderer inspector points to MatPC.mat. We were hoping that since the material is marked as addressable, it would be loaded by default using its address. This would allow us to exclude the PC group in a mobile platform build and have that reference automatically use MatMobile.mat instead. However, in testing in the editor, if we exclude the PC group from the content build, it still uses MatPC.mat. So it seems that the system doesn’t load dependencies using the addressable address this way.

Is there a way to get this behaviour out of the Addressables system? Do we have to swap out the references ourselves in a scene post process to achieve this?

So I have removed my scene from the build settings and I loaded the scene from a startup scene with a path reference so there should be no static dependencies to the addressable scene. I have excluded the PC group from the build and included the Mobile group. However, when the scene is loaded (using the Addressables.LoadSceneAsync call), the event viewer shows just defaultlocalgroup_scenes_all and defaultlocalgroup_unitybuiltinshaders as the only loaded dependencies and the material being used in the scene is still MatPC.mat.

I get that the Default group contains the scene and all its dependencies but since the MatPC.mat material is an addressable, the only copy of it should be in the PC group right? Where is it coming from?