22 lines
377 B
GDScript
Executable File
22 lines
377 B
GDScript
Executable File
extends StaticBody
|
|
|
|
var on = false
|
|
|
|
export var meshPath : NodePath
|
|
onready var mesh : Node = get_node(meshPath)
|
|
var material
|
|
|
|
func _ready():
|
|
$Light.hide()
|
|
material = mesh.get_surface_material(0)
|
|
|
|
func interact(_relate):
|
|
if on:
|
|
on = false
|
|
$Light.hide()
|
|
material.emission_energy = 0
|
|
else:
|
|
on = true
|
|
$Light.show()
|
|
material.emission_energy = 2
|