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

feat: 更新UI组件,添加能量条和颜色条,优化能量管理逻辑

This commit is contained in:
2025-08-27 20:27:01 +08:00
parent b4d11ee98a
commit 54a4113394
10 changed files with 107 additions and 36 deletions
+7 -9
View File
@@ -86,13 +86,11 @@ static func generate(
var instances = []
for i in range(count):
var instance: BulletBase = bullet.instantiate()
if launchBy.energy < instance.needEnergy:
continue
launchBy.energy -= instance.needEnergy
instance.launcher = launchBy
instance.position = spawnPosition
instance.rotation = spawnRotation + deg_to_rad(randf_range(-launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT), launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT)))
if addToWorld:
WorldManager.rootNode.add_child(instance)
instances.append(instance)
if launchBy.useEnergy(instance.needEnergy):
instance.launcher = launchBy
instance.position = spawnPosition
instance.rotation = spawnRotation + deg_to_rad(randf_range(-launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT), launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT)))
if addToWorld:
WorldManager.rootNode.add_child(instance)
instances.append(instance)
return len(instances)