Example #1
0
    public void TakeDamage(int damage)
    {
        //Reduce health. If runs out of hp, add money and return to pool
        startingHP -= damage; //Just instantly kill since this is just a prototype
        pfx.SpawnPfx_EnemyHurt(transform.position);
        SfxPlayer.instance.Play_EnemyHurt();

        if (startingHP <= 0)
        {
            gm.AddMoney(reward);
            ReturnToPool();
        }
    }