Ejemplo n.º 1
0
    public void ReduceHpPerSec(double addDamage)
    {
        //reduce HP every second
        if (Time.time > nextReduceHp)
        {
            nextReduceHp = Time.time + reduceHpRate;

            if (healthSystem.GetHealth() > 0)
            {
                outOfHealth = false;
                healthSystem.Damaged(addDamage);
                //sMask.ReducePersec();
                //Debug.Log("hp " + healthSystem.GetHealth());
            }

            if (healthSystem.GetHealth() == 0)
            {
                outOfHealth = true;
                counter     = 0;
                sMask.OutofHealth();
            }
        }
    }