Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        projektil missile = collider.gameObject.GetComponent <projektil>();

        if (missile)
        {
            snaga -= missile.GetDamage();
            missile.Hit();
            if (snaga <= 0)
            {
                Die();
            }
        }
    }
    // Use this for initialization
    private void OnTriggerEnter2D(Collider2D collider)
    {
        projektil missile = collider.gameObject.GetComponent <projektil>();

        if (missile)
        {
            missile.Hit();
            snaga -= missile.GetDamage();
            if (snaga <= 0)
            {
                AudioSource.PlayClipAtPoint(zvukUnistenja, transform.position);
                Die();
            }
        }
    }