mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
refactor(资源加载): 将preload替换为load以优化内存使用
统一使用load方法动态加载资源,减少启动时的内存占用 移动Manager类到Tools/Managers目录下 修复DirTool处理remap文件的问题
This commit is contained in:
@@ -4,7 +4,7 @@ class_name Feed
|
||||
|
||||
signal selected(applied: bool)
|
||||
|
||||
@export var avatarTexture: Texture2D = preload("res://icon.svg")
|
||||
@export var avatarTexture: Texture2D = load("res://icon.svg")
|
||||
@export var displayName: String = "未命名饲料"
|
||||
@export var quality: FeedName.Quality = FeedName.Quality.COMMON
|
||||
@export var topic: FeedName.Topic = FeedName.Topic.SURVIVAL
|
||||
@@ -69,7 +69,7 @@ func rebuildInfo():
|
||||
noField = false
|
||||
var field = fields[i]
|
||||
var value = fieldValues[i]
|
||||
var fieldShow: FieldShow = preload("res://components/UI/FieldShow.tscn").instantiate()
|
||||
var fieldShow: FieldShow = load("res://components/UI/FieldShow.tscn").instantiate()
|
||||
fieldShow.field = field
|
||||
fieldShow.value = value
|
||||
if is_instance_valid(UIState.player):
|
||||
@@ -82,7 +82,7 @@ func rebuildInfo():
|
||||
for i in range(min(costs.size(), costCounts.size())):
|
||||
var cost = costs[i]
|
||||
var count = costCounts[i]
|
||||
var costShow: ItemShow = preload("res://components/UI/ItemShow.tscn").instantiate()
|
||||
var costShow: ItemShow = load("res://components/UI/ItemShow.tscn").instantiate()
|
||||
costShow.type = cost
|
||||
costShow.count = int(count * multipiler())
|
||||
costsBox.add_child(costShow)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
extends PanelContainer
|
||||
class_name Weapon
|
||||
|
||||
@export var avatarTexture: Texture2D = preload("res://icon.svg")
|
||||
@export var avatarTexture: Texture2D = load("res://icon.svg")
|
||||
@export var displayName: String = "未命名饲料"
|
||||
@export var quality: WeaponName.Quality = WeaponName.Quality.COMMON
|
||||
@export var typeTopic: WeaponName.TypeTopic = WeaponName.TypeTopic.IMPACT
|
||||
|
||||
Reference in New Issue
Block a user