mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-07 20:27:13 +08:00
feat: 添加游戏控制和管理功能
- 新增GameControl节点用于统一处理游戏重启和退出 - 添加GameBusManager管理游戏重启时的资源清理 - 修改Pause和GameOver面板使用新的GameControl - 为EffectController和ItemDropped添加分组管理 - 统一使用WorldManager管理游戏时间
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
extends Control
|
||||
class_name GameControl
|
||||
|
||||
@onready var returnBtn: Button = $%returnBtn
|
||||
@onready var exitBtn: Button = $%exitBtn
|
||||
|
||||
func _ready():
|
||||
returnBtn.pressed.connect(
|
||||
func():
|
||||
disable()
|
||||
GameBusManager.restart(get_tree())
|
||||
)
|
||||
exitBtn.pressed.connect(
|
||||
func():
|
||||
disable()
|
||||
get_tree().quit()
|
||||
)
|
||||
enable()
|
||||
|
||||
func enable():
|
||||
returnBtn.disabled = false
|
||||
exitBtn.disabled = false
|
||||
func disable():
|
||||
returnBtn.disabled = true
|
||||
exitBtn.disabled = true
|
||||
Reference in New Issue
Block a user