objects can be selected
This commit is contained in:
@@ -25,6 +25,8 @@ var target_item
|
||||
|
||||
var target_action: String
|
||||
|
||||
var is_selected: bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
nav_agent = $NavigationAgent3D
|
||||
meshI = $MeshInstance3D
|
||||
@@ -112,3 +114,23 @@ func _on_item_received():
|
||||
if holdingItem != null:
|
||||
pass
|
||||
#holdingItem.use()
|
||||
|
||||
|
||||
func _on_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_mouse_entered() -> void:
|
||||
Global.object_over_mouse_selected_signal.emit(self)
|
||||
enable_outline()
|
||||
|
||||
|
||||
func _on_mouse_exited() -> void:
|
||||
if is_selected == false:
|
||||
disable_outline()
|
||||
|
||||
|
||||
func enable_outline():
|
||||
$MeshOutline.visible = true
|
||||
func disable_outline():
|
||||
$MeshOutline.visible = false
|
||||
|
||||
Reference in New Issue
Block a user