chore:完善项目目录结构和基础框架

- 添加核心系统框架目录结构
- 创建游戏模块化组织架构
- 添加数据配置和本地化支持
- 建立脚本分类管理体系
- 创建场景预制件管理目录
This commit is contained in:
2025-12-24 20:38:57 +08:00
parent 15548ebb52
commit 73478c0500
39 changed files with 551 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
extends Node
# 游戏管理器 - 全局游戏状态管理
# 单例模式,管理游戏的整体状态和生命周期
signal game_state_changed(new_state: GameState)
enum GameState {
LOADING, # 加载中
AUTH, # 认证状态
MAIN_MENU, # 主菜单
IN_GAME, # 游戏中
PAUSED, # 暂停
SETTINGS # 设置
}
var current_state: GameState = GameState.LOADING
var previous_state: GameState = GameState.LOADING
var current_user: String = ""
var game_version: String = "1.0.0"
func _ready():
print("GameManager 初始化完成")
change_state(GameState.AUTH)
func change_state(new_state: GameState):
if current_state == new_state:
return
previous_state = current_state
current_state = new_state
print("游戏状态变更: ", GameState.keys()[previous_state], " -> ", GameState.keys()[current_state])
game_state_changed.emit(new_state)
func get_current_state() -> GameState:
return current_state
func get_previous_state() -> GameState:
return previous_state
func set_current_user(username: String):
current_user = username
print("当前用户设置为: ", username)
func get_current_user() -> String:
return current_user
func is_user_logged_in() -> bool:
return not current_user.is_empty()