Exemplo n.º 1
0
    public void PlayHurtEffect(GameObject other, int damageAmount)
    {
        var damageNumberTextClone = (GameObject)Instantiate(damageNumberText, other.transform.position, Quaternion.Euler(Vector3.zero));

        damageNumberTextClone.GetComponent <FloatingText>().text = "" + damageAmount;

        PlayerHealthManager playerHealthManager = other.GetComponent <PlayerHealthManager>();

        playerHealthManager.Blink();

        if (playerHealthManager.IsDying())
        {
            playerHealthManager.PlayDeadSFX();
        }
        else
        {
            playerHealthManager.PlayHitSFX();
        }
    }