예제 #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.transform.CompareTag("Sticky"))
        {
            //Grow the ball
            transform.localScale += new Vector3(.01f, .01f, .01f);
            size     += .01f;
            maxSpeed += 0.1f;
            mainCam.AddDistanceFromBall(.08f);
            other.enabled = false;

            other.transform.SetParent(this.transform);

            sizeUI.GetComponent <TMP_Text>().text = "Mass: " + Math.Round(size, 2);

            FindObjectOfType <AudioSource>().PlayOneShot(pickupSound);
        }
    }