All Projects → jbruening → Ugui Mvvm

jbruening / Ugui Mvvm

Licence: other
Unity3D uGUI mvvm databinding via the standard IXChanged interfaces used in wpf (INotifyPropertyChanged, INotifyCollectionChanged, etc)

Projects that are alternatives of or similar to Ugui Mvvm

Knight
Knight is a game framework based on Unity3D engine. It includes a complete assetbundle manager, a c# hotfix module based on ILRuntime, and a UI module based on MVVM, and other basic functions support.
Stars: ✭ 302 (+78.7%)
Mutual labels:  unity, unity3d, mvvm
Delight
Delight is an open source component-oriented framework for Unity.
Stars: ✭ 201 (+18.93%)
Mutual labels:  unity, unity3d, mvvm
Kondo
Save disk space by cleaning non-essential files from software projects.
Stars: ✭ 373 (+120.71%)
Mutual labels:  unity, unity3d, gui
Nice Lua
基于xlua的MVVM框架,支持Addressables, 统一渲染管线等Unity新特性
Stars: ✭ 207 (+22.49%)
Mutual labels:  unity, unity3d, mvvm
Rapidgui
Unity OnGUI(IMGUI) extensions for Rapid prototyping/development
Stars: ✭ 144 (-14.79%)
Mutual labels:  unity, unity3d, gui
Ignorance
Ignorance utilizes the power of ENet to provide a reliable UDP networking transport for Mirror Networking.
Stars: ✭ 158 (-6.51%)
Mutual labels:  unity, unity3d
Svelto.tasks
Svelto Tasks - C# promises compliant multi-threaded tasks runner
Stars: ✭ 159 (-5.92%)
Mutual labels:  unity, unity3d
Onesignal Unity Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Stars: ✭ 161 (-4.73%)
Mutual labels:  unity, unity3d
Kinect Vfx Graph
Use Kinect's depth feed with Unity's VFX Graph
Stars: ✭ 163 (-3.55%)
Mutual labels:  unity, unity3d
Swissarmylib
Collection of helpful utilities we use in our Unity projects.
Stars: ✭ 154 (-8.88%)
Mutual labels:  unity, unity3d
Awesome Opensource Unity
a list of curated opensource Unity packages for future proof Game Developers
Stars: ✭ 161 (-4.73%)
Mutual labels:  unity, unity3d
Dkvfx
An example that shows how to use recorded Depthkit footage with Unity VFX Graph
Stars: ✭ 162 (-4.14%)
Mutual labels:  unity, unity3d
Simple Optimized A Pathfinder
An simple and optimized grid pathfinding
Stars: ✭ 157 (-7.1%)
Mutual labels:  unity, unity3d
Gltfast
glTF runtime loading library for Unity
Stars: ✭ 156 (-7.69%)
Mutual labels:  unity, unity3d
Unitypausemenu
This is an open source Unity pause menu created for the game New Horizons, and it's completely free because of how a pause menu is a core component of a game, while the unity asset store was lacking in such an asset (until this was released on the asset store).
Stars: ✭ 160 (-5.33%)
Mutual labels:  unity, unity3d
Psd2unityimporter
An advanced PSD importer tool for Unity
Stars: ✭ 155 (-8.28%)
Mutual labels:  unity, unity3d
Dfvolume
Distance-field volume generator for Unity
Stars: ✭ 161 (-4.73%)
Mutual labels:  unity, unity3d
Vjui
Custom UI controls for VJing with Unity
Stars: ✭ 168 (-0.59%)
Mutual labels:  unity, unity3d
Aim Ik
A Unity-3D library, to procedural orientate character head (and chest) in a direction without using any animation data.
Stars: ✭ 164 (-2.96%)
Mutual labels:  unity, unity3d
Openvdbforunity
Unity plugins for OpenVDB
Stars: ✭ 166 (-1.78%)
Mutual labels:  unity, unity3d

ugui-mvvm

Unity GUI (the new one) databinding done via the standard INotifyPropertyChanged/INotifyCollectionChanged interfaces that are used in WPF applications.

Basic Use

There are two ways to create your viewmodels:

  • As MonoBehaviour-derived components
  • As POCOs, bound to via DataContext and CommandBinding components

Opening the example scene will show a mix of the ways the binding works

As a reminder, both ways require implementing INotifyPropertyChanged to work. To greatly reduce INPC workload, it is recommended you use UnityFody with the PropertyChanged plugin.

Referencing components in the binding fields.

As referencing specific components on other objects in unity is pretty much impossible, There is a new menu item that can be accessed by clicking on any component's gear icon -> 'Copy Component Reference'. This will then cause a small square button to the right of component fields of INPCBinding and CommandBinding to show up. Pressing this button will then paste the reference to the component into the field. example

Binding

Databinding

All databinding is done through the INPCBinding component. One component is needed per bound property.

  • MonoBehaviour viewmodels can be directly referenced in the INPCBinding component. DataBinding to MonoBehaviour example
  • POCOs are referenced via their instance in the DataContext component (assign the DataContext component to the INPCBinding viewmodel component field)

INPCBinding recognizes when a DataContext component is referenced as a viewmodel, and will display the DataContext's referenced type's properties, instead of the DataContext's type properties.

Converters

Converters work off of ScriptableObject child classes implementing IValueConverter. Assign the asset of the scriptableobject (you'll need a separate tool to help you to create them) to the Converter field of INPCBinding

Command binding

Command binding is only necessary if you're using DataContext. Otherwise, you can just do normal binding on the button's events to the viewmodel. Command binding is via properties returning ICommand, just like with WPF.

ICommand's CanExecute and CanExecuteChanged will cause the CommandBinding to modify the view's 'interactable' property (from type Selectable). This is shown in both example scenes with the 'Can Toggle' and 'Can Say Something' toggles. CommandBinding to POCO DataContext example

Collections

Collections can be done via ItemsControl components. The viewmodel collection must be an IEnumerable, with optionally implementing INotifyCollectionChanged.

Because the event binding gets set up at compile time, as well as it being harder to create UnityEngine.Object types (cannot simply new()), it is recommended you use POCOs as collection items. ItemsControl example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].