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,42 @@
using Unity.Properties;
using UnityEngine;
namespace DanieleMarotta.RiversongCodeShowcase
{
public class HousePanelUpgradeMaterialModel : UIModel
{
private int _remaining;
private bool _done;
public HousePanelUpgradeMaterialModel(ProductDefinition product, int needed)
{
Product = product;
Needed = needed;
}
public HousePanelUpgradeMaterialModel(IProductAmount productAmount) : this(productAmount.Product, productAmount.Amount)
{
}
public ProductDefinition Product { get; }
[CreateProperty] public Sprite Icon => Product.Icon;
[CreateProperty]
public int Remaining
{
get => _remaining;
set => SetProperty(ref _remaining, value);
}
[CreateProperty] public int Needed { get; }
[CreateProperty]
public bool Done
{
get => _done;
set => SetProperty(ref _done, value);
}
}
}