From 5e029aa6164b666c6d2a4d771085e6c4f93ff380 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 8 Jan 2023 00:15:11 +0100 Subject: [PATCH] Add debug growth to cycle plant growth --- island/CropTile.gd | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/island/CropTile.gd b/island/CropTile.gd index b63138d..377af0b 100644 --- a/island/CropTile.gd +++ b/island/CropTile.gd @@ -7,6 +7,7 @@ signal on_complete() @onready var growth_timer: Timer = $GrowthTimer @onready var sprout_mesh: MeshInstance3D = $Plant/Sprout +@export var debug_growth: bool = false func plant(): @@ -19,8 +20,15 @@ func complete(): if not growth_timer.is_stopped(): growth_timer.stop() emit_signal("on_complete") + if debug_growth: + plant() func _process(_delta): var scale_factor = 1 - (growth_timer.time_left / growth_timer.wait_time) sprout_mesh.scale = Vector3(scale_factor, scale_factor, scale_factor) + + +func _ready(): + if debug_growth: + plant()