예제 #1
0
    public void DealDamage(int damage)
    {
        health -= damage;

        GamePlayController.instance.PlayerLifeCounter(health);

        playerAnim.Hurt();
        if (health <= 0)
        {
            GamePlayController.instance.playerAlive = false;
            GetComponent <Collider2D>().enabled     = false;
            playerAnim.Dead();
            blood_FX[Random.Range(0, blood_FX.Length)].SetActive(true);
            GamePlayController.instance.GameOver();
        }
    }