forked from moyin/whale-town-front
feat: 增加通知板场景
- 增加通知板与用户交互,点击E,弹出通知消息 - 预留前端调用后端获取通知的接口,当不可用时,使用mock data
This commit is contained in:
13
scenes/prefabs/items/NoticeBoard.gd
Normal file
13
scenes/prefabs/items/NoticeBoard.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends StaticBody2D
|
||||
|
||||
func interact():
|
||||
print("Interacted with Notice Board")
|
||||
|
||||
# Check if dialog already exists
|
||||
if get_tree().root.has_node("NoticeDialog"):
|
||||
return
|
||||
|
||||
var dialog = preload("res://scenes/ui/notice_dialog.tscn").instantiate()
|
||||
dialog.name = "NoticeDialog"
|
||||
get_tree().root.add_child(dialog)
|
||||
return null # No bubble text needed
|
||||
Reference in New Issue
Block a user