nieuwe kamer nieuwe kansen
This commit is contained in:
+15
-10
@@ -1,15 +1,13 @@
|
||||
extends Node3D
|
||||
|
||||
@onready var indirect_light = $"../IndirectLight"
|
||||
@onready var dakraam = $"../Room/Dakraam"
|
||||
@onready var light = $"../Light"
|
||||
var dakraam_glas
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
if dakraam:
|
||||
dakraam_glas = $"../Room/Dakraam".get_surface_override_material(0)
|
||||
|
||||
func _on_lock_input_event(camera, event, position, normal, shape_idx):
|
||||
if event is InputEventMouseButton and event.is_action_pressed("interact"):
|
||||
@@ -20,5 +18,12 @@ func _on_lock_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 + 180
|
||||
$".."/Light.visible = !$".."/Light.visible
|
||||
$Lever.rotation.z = $Lever.rotation.z + PI
|
||||
if light != null:
|
||||
light.visible = !light.visible
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user