特效新内容。修复gameplay致命bug和分数保存bug
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user