meat_madness_redux/godot/effects/SinkBlock.gd

22 lines
637 B
GDScript

extends MeshInstance
onready var global_event_bus = get_node("/root/GlobalEventBus")
func _ready():
var mat = get_active_material(0).next_pass
if Util.meat_sink_parameters == null:
yield(Util, "meat_sink_parameters")
if not Util.meat_sink_parameters.mind_fuck:
mat.set_shader_param("alpha", 0.07)
else:
mat.set_shader_param("alpha", 1.0)
func _on_SinkRegion_body_entered(body: Node):
if body.get_parent() == Util.player:
global_event_bus.emit_signal("player_entered_meat_sink")
func _on_SinkRegion_body_exited(body: Node):
if body.get_parent() == Util.player:
global_event_bus.emit_signal("player_exited_meat_sink")