特效新内容。修复gameplay致命bug和分数保存bug

This commit is contained in:
FloatGaming
2026-02-16 01:55:18 +08:00
parent 3a7a0b4669
commit 9f7c1c57b7
206 changed files with 112684 additions and 857 deletions
+13 -1
View File
@@ -82,12 +82,24 @@ public class EffectSystem : MonoBehaviour
// Captured target for callback
GameObject targetToHit = t;
bool isEnemyTarget = targetIsEnemy;
// Calculate damage info for explosion effect (Ally -> Enemy only)
(float damage, float maxHealth)? damageInfo = null;
if (isEnemyTarget && effectType == EffectType.DamageSingleEnemy)
{
var ec = targetToHit.GetComponent<EnemyCombatant>();
if (ec != null)
{
float effectiveDamage = amount * (1f - ec.damageResistance);
damageInfo = (effectiveDamage, (float)ec.maxHP);
}
}
GfxController.Instance.PlayProjectile(source, t, (finalPos) => {
// Only play hit FX when projectile arrives
if (targetToHit != null && GfxController.Instance != null)
{
GfxController.Instance.PlayHitFX(targetToHit, null, isEnemyTarget, finalPos);
GfxController.Instance.PlayHitFX(targetToHit, null, isEnemyTarget, finalPos, null, damageInfo);
}
});
}