ChooseYourSeeds menu
This commit is contained in:
parent
91d85199a7
commit
c9dd4cf175
23 changed files with 471 additions and 95 deletions
22
scripts/components/gui/seedpackets/HotbarHandler.cs
Normal file
22
scripts/components/gui/seedpackets/HotbarHandler.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using Godot;
|
||||
public class HotbarHandler : SeedpacketHandler, ISeedpacketPress, ISeedpacketProcess, ISeedpacketUnfocus
|
||||
{
|
||||
public HotbarHandler(Seedpacket owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public void Pressed()
|
||||
{
|
||||
PlantField.Instance.SetPlant(_owner,_owner.GetPlantResource());
|
||||
}
|
||||
|
||||
public void Process()
|
||||
{
|
||||
_owner.disablePacket = RuntimeLevelData.Instance.SunCount < _owner.GetPlantResource().Cost;
|
||||
}
|
||||
public void OnUnfocused()
|
||||
{
|
||||
PlantField.Instance.ResetPlant();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue