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:
@@ -14,4 +14,4 @@ func ai():
|
||||
PresetBulletAI.trace(self, tracer.getTrackingAnchor(), clamp(speed / 50 * tracePower, 0, 1))
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
func destroy(_b):
|
||||
EffectController.create(preload("res://components/Effects/LGBTBoom.tscn"), position).shot()
|
||||
EffectController.create(load("res://components/Effects/LGBTBoom.tscn"), position).shot()
|
||||
|
||||
@@ -21,7 +21,7 @@ func ai():
|
||||
warn.size = Vector2.ONE * 2 * radius * (timeLived() / countdown)
|
||||
label.text = "NUCLEAR WARNING %.1f" % ((countdown - timeLived()) / 1000)
|
||||
func destroy(_b):
|
||||
EffectController.create(preload("res://components/Effects/NuclearExplosion.tscn"), global_position).shot()
|
||||
EffectController.create(load("res://components/Effects/NuclearExplosion.tscn"), global_position).shot()
|
||||
hitbox.disabled = false
|
||||
CameraManager.shake(5000, 500, func(_c, t, r): return t * r) # 震屏强度随进度递减
|
||||
await TickTool.frame(5)
|
||||
|
||||
@@ -3,12 +3,12 @@ extends BulletBase
|
||||
func ai():
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
func destroy(_beacuseMap: bool):
|
||||
var eff = EffectController.create(preload("res://components/Effects/PurpleCrystalExplosion.tscn"), global_position)
|
||||
var eff = EffectController.create(load("res://components/Effects/PurpleCrystalExplosion.tscn"), global_position)
|
||||
eff.rotation = rotation
|
||||
eff.shot()
|
||||
func split(index, total, _last):
|
||||
BulletBase.generate(
|
||||
preload("res://components/Bullets/PurpleCrystal.tscn"),
|
||||
load("res://components/Bullets/PurpleCrystal.tscn"),
|
||||
launcher,
|
||||
position,
|
||||
rotation + deg_to_rad(360 / total * index),
|
||||
@@ -17,7 +17,7 @@ func split(index, total, _last):
|
||||
)
|
||||
func refract(entity, _index, _total, _last):
|
||||
BulletBase.generate(
|
||||
preload("res://components/Bullets/PurpleCrystal.tscn"),
|
||||
load("res://components/Bullets/PurpleCrystal.tscn"),
|
||||
launcher,
|
||||
position,
|
||||
position.angle_to_point(entity.position) if is_instance_valid(entity) else randf_range(0, deg_to_rad(360)),
|
||||
|
||||
Reference in New Issue
Block a user