22 lines
461 B
C#
22 lines
461 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class PlantSlot : Node
|
|
{
|
|
[Export] private PlantResource _resource;
|
|
[Export] private Label _cost;
|
|
[Export] private TextureRect _icon;
|
|
|
|
public void SetPlantResource( PlantResource resource )
|
|
{
|
|
_resource = resource;
|
|
|
|
UpdateContents();
|
|
}
|
|
|
|
private void UpdateContents()
|
|
{
|
|
_cost.Text = _resource.Cost.ToString();
|
|
_icon.Texture = _resource.Preview;
|
|
}
|
|
}
|