newlon/scripts/resources/PlantReward.cs
2025-07-25 18:48:49 +05:00

29 lines
557 B
C#

using Godot;
namespace Newlon.Resources;
[GlobalClass]
[Tool]
public partial class PlantReward : RewardResource
{
[Export]
public PlantResource Plant { get; private set; }
public override PackedScene GetPreview()
{
return Plant.Scene;
}
public override bool Redeem()
{
if (PlayerProgress.Instance.PlayerPlants.Contains(Plant) == false)
{
PlayerProgress.Instance.PlayerPlants.Add(Plant);
return true;
}
else
{
return false;
}
}
}