riversong code showcase
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using Unity.Properties;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class BuildMenuBuildingModel : UIModel
|
||||
{
|
||||
private BuildingDefinition _building;
|
||||
|
||||
private bool _isUnlocked;
|
||||
|
||||
private string _unlockConditions;
|
||||
|
||||
public BuildingDefinition Building
|
||||
{
|
||||
get => _building;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _building, value);
|
||||
|
||||
if (!_building) return;
|
||||
|
||||
BuildingName = _building.BuildingName;
|
||||
NotifyPropertyChanged(nameof(BuildingName));
|
||||
|
||||
BuildingDescription = _building.BuildingDescription;
|
||||
NotifyPropertyChanged(nameof(BuildingDescription));
|
||||
}
|
||||
}
|
||||
|
||||
[CreateProperty] public string BuildingName { get; private set; }
|
||||
|
||||
[CreateProperty] public string BuildingDescription { get; private set; }
|
||||
|
||||
public bool IsUnlocked
|
||||
{
|
||||
get => _isUnlocked;
|
||||
set => SetProperty(ref _isUnlocked, value);
|
||||
}
|
||||
|
||||
[CreateProperty]
|
||||
public string UnlockConditions
|
||||
{
|
||||
get => _unlockConditions;
|
||||
set => SetProperty(ref _unlockConditions, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user