riversong code showcase
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using Unity.Properties;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class BuildingPanelModel : UIModel
|
||||
{
|
||||
private Building _building;
|
||||
|
||||
private string _buildingName;
|
||||
|
||||
private string _buildingDescription;
|
||||
|
||||
private Sprite _buildingIcon;
|
||||
|
||||
private bool _showNoHouseNearbyWarning;
|
||||
|
||||
public Building Building
|
||||
{
|
||||
get => _building;
|
||||
private set => SetProperty(ref _building, value);
|
||||
}
|
||||
|
||||
[CreateProperty]
|
||||
public string BuildingDescription
|
||||
{
|
||||
get => _buildingDescription;
|
||||
private set => SetProperty(ref _buildingDescription, value);
|
||||
}
|
||||
|
||||
[CreateProperty]
|
||||
public string BuildingName
|
||||
{
|
||||
get => _buildingName;
|
||||
private set => SetProperty(ref _buildingName, value);
|
||||
}
|
||||
|
||||
[CreateProperty]
|
||||
public Sprite BuildingIcon
|
||||
{
|
||||
get => _buildingIcon;
|
||||
private set => SetProperty(ref _buildingIcon, value);
|
||||
}
|
||||
|
||||
[CreateProperty]
|
||||
public bool ShowNoHouseNearbyWarning
|
||||
{
|
||||
get => _showNoHouseNearbyWarning;
|
||||
set => SetProperty(ref _showNoHouseNearbyWarning, value);
|
||||
}
|
||||
|
||||
public HousePanelModel HouseModel { get; } = new();
|
||||
|
||||
public StoragePanelModel StorageModel { get; } = new();
|
||||
|
||||
public void SetBuilding(Building building)
|
||||
{
|
||||
Building = building;
|
||||
BuildingName = Building?.Definition.BuildingName;
|
||||
BuildingDescription = Building?.Definition.BuildingDescription;
|
||||
BuildingIcon = Building?.Definition.Icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user