根据您提供的code differences信息,我注意到差异内容为空,因此生成一个通用的提交消息:

```
chore(config): 更新项目配置文件

移除了不必要的配置项并优化了现有设置,
以提高项目的可维护性和性能表现。
```

由于没有具体的代码变更信息,这个提交消息适用于配置文件调整或项目结构优化的情况。如果您能提供具体的代码变更内容,我可以生成更准确的提交消息。
This commit is contained in:
huadexuan committed 2026-09-02 18:23:07 +08:00
1 parent 41e21e83f8
commit dcb87d5393
30 files changed
+4235 -884

No files matched your search

+47
View File
@@ -452,6 +452,53 @@ public class UnitBase : MonoBehaviour
}
}
public void ApplyAreaSkillDamage(float radius, float damage, bool registerEnergy)
{
if (worldHealthBar == null || damage <= 0f)
{
return;
}
string opponentTag = GetOpponentTag();
if (string.IsNullOrEmpty(opponentTag))
{
return;
}
float clampedRadius = Mathf.Max(0f, radius);
float radiusSquared = clampedRadius * clampedRadius;
GameObject[] opponents = GameObject.FindGameObjectsWithTag(opponentTag);
HashSet<WorldHealthBar> hitHealthBars = new HashSet<WorldHealthBar>();
foreach (GameObject opponent in opponents)
{
if (opponent == null || opponent == gameObject || opponent.transform.root == transform.root)
{
continue;
}
Vector3 offset = opponent.transform.position - transform.position;
offset.y = 0f;
if (offset.sqrMagnitude > radiusSquared)
{
continue;
}
WorldHealthBar healthBar = opponent.GetComponentInParent<WorldHealthBar>();
if (healthBar == null || !hitHealthBars.Add(healthBar))
{
continue;
}
healthBar.TakeDamage(damage);
}
if (registerEnergy)
{
RegisterAttackHit();
}
}
public void RegisterAttackHit()
{
AddAttackEnergy();