https://github.com/gamgaroo/samples
Gamgaroo Unity Packages usage samples.
https://github.com/gamgaroo/samples
data-binding mvvm reactive sample unity unity3d view viewmodel
Last synced: 3 months ago
JSON representation
Gamgaroo Unity Packages usage samples.
- Host: GitHub
- URL: https://github.com/gamgaroo/samples
- Owner: gamgaroo
- License: mit
- Created: 2020-05-26T19:19:20.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2020-06-05T13:19:29.000Z (about 6 years ago)
- Last Synced: 2025-10-09T06:05:10.579Z (9 months ago)
- Topics: data-binding, mvvm, reactive, sample, unity, unity3d, view, viewmodel
- Language: C#
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Samples
## S01: Basics
This is a simple sample of how to bind a View to a ViewModel's Reactive Property.
```csharp
public sealed class TestBehaviour : MonoBehaviour
{
private readonly IReactiveProperty _time = new ReactiveProperty();
private void Start()
{
// Bind the View to the Property
GetComponent().Bind(_time);
}
private void Update()
{
// Update the Property value
_time.Value += Time.deltaTime;
}
}
```
Run the Scene to see how the View is updating every frame when the Reactive Property value updates.
## S02: RTS UI
This is a more complex sample of how to create nested Views and set/bind values of ViewModels.
The video below shows the functionality of the sample.
[](https://www.youtube.com/watch?v=YAnY434Kx3g "Video Sample")