Best way to show a noesis UI within Unity
This seems like it should be really obvious (perhaps should be covered by the documentation?) so maybe I'm just being stupid, but I'm Just wondering what the best way to actually show a Neosis menu in Unity is.
I assume enabling and disabling the Neosis View component on the main camera is the normal way of showing and hiding a menu but it seems like I'm limited to one Neosis View component per camera object. So if I want the ability to show a pause menu or an inventory screen from within the same scene then is it common practice to just change the XAML property of that neosis view component at runtime (based on which menu I want to show) and then enable the component to show the menu?
If that's the normal way of using it then does that mean I can only ever show one neosis UI at once? Say I wanted to have an overlay in the top right of the screen that tracks a quest, but then also have the ability to bring up the pause menu (full screen) or inventory view (that only covers part of the screen), how would that work?
Thanks
I assume enabling and disabling the Neosis View component on the main camera is the normal way of showing and hiding a menu but it seems like I'm limited to one Neosis View component per camera object. So if I want the ability to show a pause menu or an inventory screen from within the same scene then is it common practice to just change the XAML property of that neosis view component at runtime (based on which menu I want to show) and then enable the component to show the menu?
If that's the normal way of using it then does that mean I can only ever show one neosis UI at once? Say I wanted to have an overlay in the top right of the screen that tracks a quest, but then also have the ability to bring up the pause menu (full screen) or inventory view (that only covers part of the screen), how would that work?
Thanks
Re: Best way to show a noesis UI within Unity
We recommend a single View for the camera that you dynamically populate with elements (loading from other XAMLs for example or just modifying the visibility).
I recommend having a look at our examples, Menu3D is doing something similar.
I recommend having a look at our examples, Menu3D is doing something similar.
Re: Best way to show a noesis UI within Unity
Thanks for the reply.
I'm having a bit of a nightmare trying to get that sample to load correctly in Blend. I downloaded it and opened the root of the "Unity" folder as a project in Unity, then installed the Noesis package.
The demo scene works fine within Unity but if I try to open the project/solution file in Blend I get a warning about incorrect .NET framework version (and no matter which option I select, the project doesn't open), so I tried using the "Open Blend Project" option from within Unity but that seems to just create a new blend project with a hello world example in it. So I excluded the hello world files and included all of the original files and had to manually update the Noesis Extensions package to get it to even recognise the noesis namespace. But even after all that I'm still getting loads of errors about resources not being found, despite the App.xaml file and resource dictionaries all being included in the project.
Are these samples meant to be easy to load in Blend ourselves? Or are they intended to just be looked through with a text editor etc.
I'm having a bit of a nightmare trying to get that sample to load correctly in Blend. I downloaded it and opened the root of the "Unity" folder as a project in Unity, then installed the Noesis package.
The demo scene works fine within Unity but if I try to open the project/solution file in Blend I get a warning about incorrect .NET framework version (and no matter which option I select, the project doesn't open), so I tried using the "Open Blend Project" option from within Unity but that seems to just create a new blend project with a hello world example in it. So I excluded the hello world files and included all of the original files and had to manually update the Noesis Extensions package to get it to even recognise the noesis namespace. But even after all that I'm still getting loads of errors about resources not being found, despite the App.xaml file and resource dictionaries all being included in the project.
Are these samples meant to be easy to load in Blend ourselves? Or are they intended to just be looked through with a text editor etc.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Best way to show a noesis UI within Unity
It is strange, I just downloaded that github sample, opened Menu3D-blend.sln in Blend for Visual Studio (2019 or 2022), then I built the solution (which restored the Noesis.GUI.Extensions nuget), and pressing Start (F5) executed the sample fine.
Opening from the solution explorer Assets/NoesisGUI/Samples/Menu3D/MainWindow.xaml correctly loads the page in the designer also.
If you have problems with unsupported .NET framework maybe you don't have any installed. Are you able to go to the project "Properties" and set the "Target framework:" to any installed .NET Framework like 4.7 or 4.8? There you will also see an option to install additional frameworks. Please let me know if that helps.
Opening from the solution explorer Assets/NoesisGUI/Samples/Menu3D/MainWindow.xaml correctly loads the page in the designer also.
If you have problems with unsupported .NET framework maybe you don't have any installed. Are you able to go to the project "Properties" and set the "Target framework:" to any installed .NET Framework like 4.7 or 4.8? There you will also see an option to install additional frameworks. Please let me know if that helps.
Re: Best way to show a noesis UI within Unity
If I select the option to upgrade to .NET 4.8 then the project still just doesn't load (no errors or anything). So I tried manually editing the .csproj file to change the target framework to 4.8 and now that lets me open it in Blend successfully and then hitting build fixes all the errors and sorts out the extensions package like you said. I forgot WPF is weird like that and will actually compile even with 48 errors listed (and actually fixes them). Thanks for the reminder :)
I'll play around with the example and see if that answers my initial question, but one more related question before I forget:
Is it common to use multiple cameras within Unity to allow multiple Noesis View components to be used at the same time within the same scene? or is that not something you should ever have to do?
I'm thinking if I wanted my main HUD (quest tracker, health, etc) to still be visible in the background while I bring up another Noesis screen (maybe a pause menu or something similar). Would you use multiple cameras for that or would you stick to what someone else said about trying to just have one XAML layout that can show everything and just toggle which parts are visible.
I'll play around with the example and see if that answers my initial question, but one more related question before I forget:
Is it common to use multiple cameras within Unity to allow multiple Noesis View components to be used at the same time within the same scene? or is that not something you should ever have to do?
I'm thinking if I wanted my main HUD (quest tracker, health, etc) to still be visible in the background while I bring up another Noesis screen (maybe a pause menu or something similar). Would you use multiple cameras for that or would you stick to what someone else said about trying to just have one XAML layout that can show everything and just toggle which parts are visible.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Best way to show a noesis UI within Unity
I suggest to use a single camera and play with the visibility of elements in the NoesisView to show/hide parts of the UI. That is exactly what Menu3D sample is doing.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 27 guests