A few questions about working with Noesis and Unity
Hello guys, after playing around with Noesis I was able to get some simple UI's set up with Unity and get basic interaction but I have a few questions about the general workflow. The first question I have is whether or not I can interact with views/UI's without making the ViewModel a Monobehaviour. For example, take the "NorthGame" example, would it be possible to create a menu that complex where the user could interact with it using a gamepad and not have to create a Monobehaviour class to do so or does all interaction within Unity need the ViewModels to be a Monobehaviour?
The second question I have is whether or not it is possible to have the user interact with a Noesis menu or UI element using Unity's new input system?
Thanks
-Joshmond
The second question I have is whether or not it is possible to have the user interact with a Noesis menu or UI element using Unity's new input system?
Thanks
-Joshmond
-
-
sfernandez
Site Admin
- Posts: 2540
- Joined:
Re: A few questions about working with Noesis and Unity
ViewModels don't need to be MonoBehaviors to interact with the View (although it could be handy sometimes to directly edit properties within Unity editor). Communication between the View and ViewModel should be done (if following the recommended MVVM pattern) using bindings to properties and commands.For example, take the "NorthGame" example, would it be possible to create a menu that complex where the user could interact with it using a gamepad and not have to create a Monobehaviour class to do so or does all interaction within Unity need the ViewModels to be a Monobehaviour?
Then input iteraction from a gamepad is just about handling the keyboard focus in the view. If you set the focus to a Button in your view, for example using interactivity:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" KeyboardNavigation.DirectionalNavigation="Cycle">
<Button Content="First">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<noesis:SetFocusAction />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Content="Second"/>
<Button Content="Third"/>
</StackPanel>
</Grid>
As I said in other ticket, it is not yet supported but we are implementing it for a future release: #1828.The second question I have is whether or not it is possible to have the user interact with a Noesis menu or UI element using Unity's new input system?
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 1 guest