riversong code showcase
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user