objects can be selected
This commit is contained in:
@@ -11,6 +11,8 @@ var default_shaders: Array
|
||||
#var ActionNode: Node3D
|
||||
var is_placed: bool = false
|
||||
|
||||
var is_selected: bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
BuildManager.preview_created.connect(_on_preview_create)
|
||||
BuildManager.object_placed.connect(_on_object_placed)
|
||||
@@ -61,15 +63,19 @@ func _on_object_placed(build_postion):
|
||||
|
||||
|
||||
func enable_outline():
|
||||
Global.object_over_mouse_selected_signal.emit(self)
|
||||
for i in meshInstance.get_surface_override_material_count():
|
||||
var material = meshInstance.get_surface_override_material(i)
|
||||
if material.next_pass != null:
|
||||
meshInstance.get_surface_override_material(i).next_pass.set_shader_parameter("is_active", true)
|
||||
func disable_outline():
|
||||
for i in meshInstance.get_surface_override_material_count():
|
||||
var material = meshInstance.get_surface_override_material(i)
|
||||
if material.next_pass != null:
|
||||
meshInstance.get_surface_override_material(i).next_pass.set_shader_parameter("is_active", false)
|
||||
Global.object_over_mouse_unselected_signal.emit(self)
|
||||
|
||||
if is_selected == false:
|
||||
for i in meshInstance.get_surface_override_material_count():
|
||||
var material = meshInstance.get_surface_override_material(i)
|
||||
if material.next_pass != null:
|
||||
meshInstance.get_surface_override_material(i).next_pass.set_shader_parameter("is_active", false)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user