mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
refactor(资源加载): 将preload替换为load以优化内存使用
统一使用load方法动态加载资源,减少启动时的内存占用 移动Manager类到Tools/Managers目录下 修复DirTool处理remap文件的问题
This commit is contained in:
@@ -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