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

35 lines
614 B
C#

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;
[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();
}
}
}