example-grass/Eat Da Rich/Eat/Eatable.cs

35 lines
614 B
C#
Raw Normal View History

2025-07-20 11:22:53 +00:00
using Godot;
using System.Collections;
using System.Collections.Generic;
using Godot.Collections;
namespace Rokojori
{
[GlobalClass,Tool]
public partial class Eatable:Node
{
[Export]
public Action onGotEaten;
2025-07-22 14:08:35 +00:00
[Export]
public bool isEatable = true;
[Export]
public float notEatableSince = 0;
public void GetEaten()
{
if ( ! isEatable )
{
return;
}
isEatable = false;
notEatableSince = TimeLine.osTime;
Action.Trigger( onGotEaten );
Unique<RichCounter>.Get().CountUp();
}
2025-07-20 11:22:53 +00:00
}
}