1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

refactor: 修改子弹实例添加到场景的方法调用方式

将直接调用call_deferred改为通过add_child属性调用,保持代码风格一致
This commit is contained in:
2026-05-10 14:58:31 +08:00
parent 6b7801e1ce
commit f7861a26c4
+1 -1
View File
@@ -277,7 +277,7 @@ static func generate(
instance.position = spawnPosition
instance.rotation = spawnRotation + deg_to_rad(launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT) * randf_range(-1, 1) * int(!ignoreOffset))
if addToWorld:
WorldManager.rootNode.call_deferred("add_child", instance)
WorldManager.rootNode.add_child.call_deferred(instance)
instance.add_to_group("bullets")
instances.append(instance)
return instances