I ran into this as well,
but I found a solution.
1. I use addressables for all of my assets. There are no static asset links in the project and no scene. This ensures we are 100% mod compatible, forced to dog food our asset loading pipeline. I create my main camera and NoesisView in a bootstrapper at game start.
(The Noesis inspector can't find dependencies for the preview view if the referenced assets are addressables. I don't have a solution for that yet, but that is a source of console spew. I suspect an editor plugin that is aware of addressables and can load them into the NoesisXamlProvider instance during an editor session is all that's needed.)
2. I have a manifest system that allows me to associate a key with an asset url. This url can be an Address or it can be a file path to the mod directory. A loader is responsible for loading the asset from the correct location.
Example:
<UIs>
<UI id="main_window" url="AOR/UI/MainWindow"/> // This is an address to an Addressable.
<UI id="main_menu_panel" url="AOR/UI/MainMenu/MainMenuPanel"/>
<UI id="hud_panel" url="AOR/UI/HUD/HudPanel"/>
<UI id="modded_panel" url="mod://MyBigMod/MainPanel"/> // This is a path to a file on disk in the Mod directory.
</UIs>
All of these panels would be loaded at game start, along with any references by other mod <UIs> manifests.
3. Noesis cannot handle links to assets via address, natively. But it does have the provider API.
When I load each of these assets, I register them upon load:
private LoadedAsset<NoesisXaml> _noesisXaml;
public NoesisXaml noesisXaml => _noesisXaml.asset;
public async Task LoadAsync(UIData data)
{
// I write loaders for all asset types in my game which are aware of addressables and disk files (for mods).
var noesisXamlLoader = new NoesisXamlLoader();
_noesisXaml = await noesisXamlLoader.LoadAsync(data.url);
NoesisXamlProvider.instance.Register(data.id, noesisXaml);
}
This associates the id (key) with the actual asset.
4. During runtime, I can use the path argument on LoadComponent to find my xaml:
public class MainMenuPanel : UserControl
{
public MainMenuPanel()
{
InitializeComponent();
}
private void InitializeComponent()
{
NoesisUnity.LoadComponent(this, "main_menu_panel");
}
}
This works and everything runs fine.