1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

refactor(BulletBase): 移除子弹注册方法并添加子子弹标记

移除所有子弹类中的register方法,将属性初始化移至其他位置
在BulletBase的trySplit和tryRefract方法中添加子子弹标记
This commit is contained in:
2026-01-17 12:30:09 +08:00
parent 4f25daf987
commit 1fa8263667
15 changed files with 3 additions and 38 deletions
+2
View File
@@ -151,6 +151,7 @@ func trySplit():
for i in total:
var cloned = duplicate() as BulletBase
cloned.rotation = deg_to_rad(360.0 / total * i)
cloned.isChildSplit = true
split(cloned, i, total, last)
func tryRefract():
if is_instance_valid(launcher) and !isChildRefract:
@@ -162,6 +163,7 @@ func tryRefract():
if is_instance_valid(entity):
var cloned = duplicate() as BulletBase
cloned.look_at(entity.position)
cloned.isChildRefract = true
refract(cloned, entity, i, total, last)
# 抽象方法