mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-09 19:42:54 +08:00
refactor(ComponentManager): 移除_ready中的init调用并优化初始化逻辑
移除ComponentManager.gd中冗余的_ready方法,改为在MakeFeed.gd中显式调用init 优化资源加载逻辑,确保在使用前完成初始化
This commit is contained in:
@@ -24,6 +24,7 @@ func _ready():
|
|||||||
refreshNeedBaseballCount *= 1 + randf_range(GameRule.refreshCountIncreasePercent.x, GameRule.refreshCountIncreasePercent.y)
|
refreshNeedBaseballCount *= 1 + randf_range(GameRule.refreshCountIncreasePercent.x, GameRule.refreshCountIncreasePercent.y)
|
||||||
regenerateCards()
|
regenerateCards()
|
||||||
)
|
)
|
||||||
|
ComponentManager.init()
|
||||||
for i in len(ComponentManager.feeds):
|
for i in len(ComponentManager.feeds):
|
||||||
var feed = ComponentManager.getFeed(i).instantiate() as Feed
|
var feed = ComponentManager.getFeed(i).instantiate() as Feed
|
||||||
feed.selected.connect(
|
feed.selected.connect(
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ static var uiComponents = {}
|
|||||||
static var themes = {}
|
static var themes = {}
|
||||||
static var itemTextures = {}
|
static var itemTextures = {}
|
||||||
|
|
||||||
func _ready():
|
|
||||||
init()
|
|
||||||
|
|
||||||
static func init():
|
static func init():
|
||||||
for i in DirTool.listdir("res://components/Bullets"):
|
for i in DirTool.listdir("res://components/Bullets"):
|
||||||
bullets[DirTool.getBasenameWithoutExtension(i)] = load(i)
|
bullets[DirTool.getBasenameWithoutExtension(i)] = load(i)
|
||||||
|
|||||||
Reference in New Issue
Block a user