private void FindCurrentDepthDamage() { float playerDepth = GameManager.main.PlayerDepth; float playerMaxHealth = playerHurtable.GetMaxHealth(); DepthDamage depthDamage = upgradeConfig.DepthDamages .Where(damage => playerMaxHealth < damage.HealthBelow && damage.Depth <= playerDepth) .OrderByDescending(damage => damage.Depth) .FirstOrDefault(); if (depthDamage != null) { currentDepthDamage = depthDamage; HUDUI.main.StartPressureWarning(); } else { HUDUI.main.StopPressureWarning(); currentDepthDamage = null; damageTimer = 0f; } }
public float GetMaxHealth() { return(hurtable.GetMaxHealth()); }