riversong code showcase

This commit is contained in:
Daniele Marotta
2026-05-21 15:52:18 +02:00
commit 4c9eea1c02
462 changed files with 23406 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine.UIElements;
namespace DanieleMarotta.RiversongCodeShowcase
{
public class UIModel : IUIModel
{
public event EventHandler<BindablePropertyChangedEventArgs> propertyChanged;
public event Action Changed;
protected void SetProperty<T>(ref T field, T value, [CallerMemberName] string property = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return;
field = value;
NotifyPropertyChanged(property);
}
protected void NotifyPropertyChanged(string property = null)
{
propertyChanged?.Invoke(this, new BindablePropertyChangedEventArgs(property));
}
public void NotifyChanged()
{
Changed?.Invoke();
}
}
}