Exemplo n.º 1
0
    // Update is called once per frame
    void OnCollisionEnter(Collision collision)
    {
        GameObject obj = collision.collider.gameObject;

        for (int i = 0; i < stars.Length; i++)
        {
            if (obj == stars[i])
            {
                guiScript.s[i] = 1;
                guiScript.RefreshStarCount();

                stars[i].GetComponent <ParticleSystem>().Play();
            }
        }
    }