GodotComponentTest/scenes/HexTile3D.gd

18 lines
478 B
GDScript

extends MeshInstance
onready var is_mouse_over = false
var old_material_override = Material.new()
func _on_Area_mouse_entered():
is_mouse_over = true
old_material_override = material_override
var material = self.get_surface_material(0)
var cloned_material = material.duplicate()
cloned_material.albedo_color = Color (1, 0, 0)
self.material_override = cloned_material
func _on_Area_mouse_exited():
is_mouse_over = false
self.material_override = old_material_override