Example #1
0
    void AddLife(float heal)
    {
        if (_invulnerable)
        {
            return;
        }

        Hp += heal;
        LightsModule.SetLifeValue(Hp / maxHP);
    }
Example #2
0
    void SubstractLife(float damage, Vector3 hitPosition)
    {
        if (_invulnerable)
        {
            return;
        }
        if (_vibrationAvailable)
        {
            ApplyVibration(0, 2, 0.2f);
            _vibrationAvailable = false;
            StartCoroutine(VibrationCooldown());
        }

        Hp -= damage;
        LightsModule.SetLifeValue(Hp / maxHP);
        _lifeForcefield.TakeDamage(hitPosition);
    }
Example #3
0
 public void ResetHP()
 {
     Hp = maxHP;
     LightsModule.SetLifeValue(Hp / maxHP);
 }