1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Tools/Managers/ComponentManager.gd
T
fallingshrimp e688f7f0c1 feat(ComponentManager): 实现组件管理器并初始化子弹资源
refactor(DirTool): 添加获取无扩展名文件名的方法
feat(WorldManager): 初始化ComponentManager

新增多个子弹资源文件并移动至统一目录
包括ForeverRainbow、ArrowSeven、SunDance、HeavyCrystal和LightGun
2025-09-21 13:05:20 +08:00

20 lines
659 B
GDScript

class_name ComponentManager
static var bullets = {}
static var characters = {}
static var effects = {}
static func init():
for i in DirTool.listdir("res://components/Bullets"):
bullets[DirTool.getBasenameWithoutExtension(i)] = load(i)
for i in DirTool.listdir("res://components/Characters"):
characters[DirTool.getBasenameWithoutExtension(i)] = load(i)
for i in DirTool.listdir("res://components/Effects"):
effects[DirTool.getBasenameWithoutExtension(i)] = load(i)
static func getBullet(name: String):
return bullets[name]
static func getCharacter(name: String):
return characters[name]
static func getEffect(name: String):
return effects[name]