splishy splashy
This commit is contained in:
+6
-10
@@ -2,28 +2,24 @@ extends Node3D
|
||||
|
||||
@onready var indirect_light = $"../IndirectLight"
|
||||
@onready var dakraam = $"../Room/Dakraam"
|
||||
@onready var light = $"../Light"
|
||||
var dakraam_glas
|
||||
|
||||
func _ready():
|
||||
if dakraam:
|
||||
dakraam_glas = $"../Room/Dakraam".get_surface_override_material(0)
|
||||
|
||||
func _on_lock_input_event(camera, event, position, normal, shape_idx):
|
||||
func _on_lock_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
||||
if get_node("../Player").has_key:
|
||||
$Deur.visible = false
|
||||
$Lock.visible = false
|
||||
|
||||
|
||||
func _on_lever_input_event(camera, event, position, normal, shape_idx):
|
||||
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):
|
||||
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
||||
$Lever.rotation.z = $Lever.rotation.z + PI
|
||||
if light != null:
|
||||
light.visible = !light.visible
|
||||
indirect_light.visible = !indirect_light.visible
|
||||
if indirect_light.visible:
|
||||
dakraam.set_surface_override_material(0, dakraam_glas)
|
||||
else:
|
||||
indirect_light.visible = !indirect_light.visible
|
||||
if indirect_light.visible:
|
||||
dakraam.set_surface_override_material(0, dakraam_glas)
|
||||
else:
|
||||
dakraam.set_surface_override_material(0, null)
|
||||
dakraam.set_surface_override_material(0, null)
|
||||
|
||||
Reference in New Issue
Block a user