generated from krampus/template-godot4
23 lines
471 B
GDScript
23 lines
471 B
GDScript
extends Node3D
|
|
|
|
@export var threshold := 100.0
|
|
@export var initial_mask: Texture
|
|
|
|
@onready var spot_light_3d: SpotLight3D = %SpotLight3D
|
|
@onready var gunk_body: GunkBody = %GunkBody
|
|
|
|
|
|
func _ready() -> void:
|
|
if initial_mask:
|
|
gunk_body.initial_mask = initial_mask
|
|
|
|
_deferred_init.call_deferred()
|
|
|
|
|
|
func _deferred_init() -> void:
|
|
gunk_body.trigger_recompute()
|
|
|
|
|
|
func _on_clear_total_updated(clear_total: float) -> void:
|
|
spot_light_3d.visible = clear_total > threshold
|