예제 #1
0
    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;
        }
    }
예제 #2
0
 public float GetMaxHealth()
 {
     return(hurtable.GetMaxHealth());
 }