Re: BETA: NoesisGUI v2.1.0b4 (Unity)
Posted: 03 Oct 2017, 22:18
I think the main problem here is that we are trying to be compatible with the standard WPF way to load XAMLs from disk:Seems to be a lot of hassle for Unity users with this as I've noticed.
From my experience, I almost never had XAML which was not used in the project, and when I had it was just a few files.
We still not updated our first game to NoesisGUI 2.x but if we had, it will be a lot of problems with it as there are hundreds of XAMLs and it's hard to determine which of them will break the game because they're not referenced via Unity system and loaded dynamically.
Why not make a mode when all XAML files in Unity project are automatically included in "Preloaded Xamls"? And use this mode by default.
Code: Select all
private void InitializeComponent()
{
Noesis.GUI.LoadComponent(this, "Assets/MainMenu.xaml");
}
In case, you want to automatically have all your XAMLs available then one unity friendly solution is having the XAMLs inside the /Resouces folder. That way, you can load the XAML using code like this (taken from our Unity tutorial):
Code: Select all
NoesisXaml xaml = (NoesisXaml)UnityEngine.Resources.Load(path, typeof(NoesisXaml));
Button button = (Button)xaml.Load();
I would say, this is exactly the same problem you have in Unity to organize rest of assets, like textures.
Having said that, we are totally open to suggestion here.