-
- shadowmage45
- Posts: 4
- Joined:
Unity Integration Questions
Hi all;
I'm investigating options for creation of UIs for use within Unity game engine, and more specifically from within a mod/plugin for the existing Unity based game Kerbal Space Program.
My initial inquiry is towards the method of integration for UIs created with Noesis and how they are compiled / made available to the Unity engine. As I'm working on an external/third-party addon to the game, I am not able to compile the UI/script with the application, and need some way to load the libraries and XAML files from disk at runtime and create the windows dynamically from plugin code (I am able to load my own plugin code compiled into managed .dll's, and believe I can load other managed dlls at runtime; disk access for file reads is not a problem).
Is this something that is doable with Noesis? Does use of the UI's require everything be 'compiled by Unity into the application', or can the libraries and XAML be loaded at runtime?
Any information is much appreciated;
I'm investigating options for creation of UIs for use within Unity game engine, and more specifically from within a mod/plugin for the existing Unity based game Kerbal Space Program.
My initial inquiry is towards the method of integration for UIs created with Noesis and how they are compiled / made available to the Unity engine. As I'm working on an external/third-party addon to the game, I am not able to compile the UI/script with the application, and need some way to load the libraries and XAML files from disk at runtime and create the windows dynamically from plugin code (I am able to load my own plugin code compiled into managed .dll's, and believe I can load other managed dlls at runtime; disk access for file reads is not a problem).
Is this something that is doable with Noesis? Does use of the UI's require everything be 'compiled by Unity into the application', or can the libraries and XAML be loaded at runtime?
Any information is much appreciated;
Re: Unity Integration Questions
Yes, it is doable. You can LoadXAML by hand from string.Is this something that is doable with Noesis? Does use of the UI's require everything be 'compiled by Unity into the application', or can the libraries and XAML be loaded at runtime?
Code: Select all
/// <summary>
/// Parses a well-formed XAML fragment and creates the corresponding object tree.
/// </summary>
public static object ParseXaml(string xamlText)
Or, maybe easier, you can create our Unity resources by hand. For example in NoesisXaml.cs, the content member is just the raw XAML.
Code: Select all
public class NoesisXaml: ScriptableObject
{
...
public string source;
public byte[] content;
...
-
- shadowmage45
- Posts: 4
- Joined:
Re: Unity Integration Questions
Excellent, thanks for the information, sounds like it should work out nicely for my intended use. I do quite a bit of WPF application design at work, and am eager to be able to use that knowledge and technology to clean up the mess that is the Unity GUI system in my personal modding endeavors.
Yes, it is doable. You can LoadXAML by hand from string.
Hope this helps!Code: Select all/// <summary> /// Parses a well-formed XAML fragment and creates the corresponding object tree. /// </summary> public static object ParseXaml(string xamlText)
Or, maybe easier, you can create our Unity resources by hand. For example in NoesisXaml.cs, the content member is just the raw XAML.
Code: Select allpublic class NoesisXaml: ScriptableObject { ... public string source; public byte[] content; ...
Might be a few weeks before I get into the project, but this will be my first stop for investigation of potential UIs. Thanks again for the info;
Regards,
John
Re: Unity Integration Questions
You really welcome. Hope to see you back.
-
- jswigartPlayful
- Posts: 5
- Joined:
Re: Unity Integration Questions
I'm curious how far you have gotten with tinkering with dynamic non compiled XAML in this way. This sort of example would be a great thing to add to the set of samples that come with NoesisGui
If you are just loading XAML, how do you handle the code behind functionality and such?
If you are just loading XAML, how do you handle the code behind functionality and such?
Re: Unity Integration Questions
Although possible we do not recommend code-behind in this scenario. The best approach is following MVVM and binding everything to the active data context. Almost all our samples are like that.If you are just loading XAML, how do you handle the code behind functionality and such?
Who is online
Users browsing this forum: Google [Bot] and 1 guest