Exemplo n.º 1
0
    private void OnParticleCollision(UnityEngine.GameObject other)
    {
        score = FindObjectOfType <Scorekeeper>();

        audioSource = GetComponent <AudioSource>();

        blood.Play();
        audioSource.PlayOneShot(arrowImpactSFX);

        if (healthPoints > 1)
        {
            healthPoints--;
        }
        else
        {
            score.ScoreIncrease();

            DeathFX();

            Instantiate(deathSFXPrefab, transform.position, Quaternion.identity);

            Destroy(gameObject);
        }
    }