godot-psd-training/sceen/platform/LCB_Area3D.gd

19 lines
479 B
GDScript3
Raw Normal View History

2024-04-17 15:26:37 +08:00
extends Area3D
@onready var mouse_over = false
func _input(event):
if event is InputEventMouseButton and event.pressed:
if mouse_over and event.button_index == MOUSE_BUTTON_LEFT: # 左键点击
2024-04-22 10:57:46 +08:00
$"../..".clickLcbSignal.emit()
2024-04-17 15:26:37 +08:00
func _on_mouse_entered() -> void:
mouse_over = true
2024-04-22 15:32:19 +08:00
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_POINTING_HAND)
2024-04-17 15:26:37 +08:00
func _on_mouse_exited() -> void:
mouse_over = false
2024-04-22 15:32:19 +08:00
Input.set_default_cursor_shape(Input.CursorShape.CURSOR_ARROW)