velho/godot/prefabs/tiles/berry_grower.gd

14 lines
256 B
GDScript

extends Node
@export var gatherable: Gatherable
@export var days_to_grow = 1
var days_grown = 0
func on_day_start():
if gatherable.get_is_picked():
days_grown += 1
if days_grown >= days_to_grow:
gatherable.set_is_picked(false)
days_grown = 0