Exemplo n.º 1
0
    public void DamageOverTime(int numTics, float ticLength)
    {
        bool killingBlow = false;

        if (numTics > 0)
        {
            //test to see if this tic will inflict a killing blow
            if (characterData.health - 1 <= 0)
            {
                killingBlow = true;
            }

            characterData.DoDamage(1);
            //Debug.Log("Health reduced to " + characterData.health + " by DoT effect");

            if (killingBlow)
            {
                return;
            }

            StartCoroutine(ExecuteAfterSeconds(ticLength, numTics));
        }
        else
        {
            spriteRenderer.color = Color.white;
        }
    }