根据您提供的code differences信息,我注意到差异内容为空,因此生成一个通用的提交消息:
``` chore(config): 更新项目配置文件 移除了不必要的配置项并优化了现有设置, 以提高项目的可维护性和性能表现。 ``` 由于没有具体的代码变更信息,这个提交消息适用于配置文件调整或项目结构优化的情况。如果您能提供具体的代码变更内容,我可以生成更准确的提交消息。
This commit is contained in:
1 parent
41e21e83f8
commit
dcb87d5393
30 files changed
+4235
-884
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class StoneGolemSkill : UnitSkill
|
||||
{
|
||||
[Header("地裂参数")]
|
||||
[Min(0f)]
|
||||
public float skillDamage = 110f;
|
||||
|
||||
[Min(0.1f)]
|
||||
public float skillRadius = 2f;
|
||||
|
||||
[Header("技能动画")]
|
||||
[Min(0f)]
|
||||
public float skillAnimationDuration = 0f;
|
||||
|
||||
private bool isSkillReady;
|
||||
|
||||
public override void ReleaseSkill()
|
||||
{
|
||||
if (unit == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
isSkillReady = true;
|
||||
unit.PlaySkillAnimation(OnSkillFinished, skillAnimationDuration);
|
||||
}
|
||||
|
||||
// 添加到地裂技能动画的命中帧;眩晕效果暂不处理。
|
||||
public void OnSkillHit1()
|
||||
{
|
||||
if (!isSkillReady)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unit.ApplyAreaSkillDamage(skillRadius, skillDamage, false);
|
||||
isSkillReady = false;
|
||||
}
|
||||
|
||||
private void OnSkillFinished()
|
||||
{
|
||||
isSkillReady = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: XnMW5C2uVn52nDo2ZCekxHmauPH9tZNCkJqe/9kpsowhANso8vBKTP4=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user