Zondre
This commit is contained in:
parent
c266d22f58
commit
2eb65c3092
24 changed files with 566 additions and 49 deletions
22
scripts/components/gui/PlantSlot.cs
Normal file
22
scripts/components/gui/PlantSlot.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue