Exemple #1
0
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.name == "Sphere(Clone)")
        {
            size.x        *= (float)0.9;
            size.z        *= (float)0.9;
            Main.gameTimer = Main.gameTimerDef;
            if (size.x > 0.8)
            {
                this.transform.localScale = size;

                Vector3 PosTemp = ObstacleMain.transform.position;
                PosTemp.x += Random.Range((float)2, (float)8);
                PosTemp.y += Random.Range((float)3, (float)5);
                this.transform.position = PosTemp;
            }
            else
            {
                Destroy(this.gameObject);
                for (int i = 0; i < 50; i++)
                {
                    Main.AddBall();
                    Debug.Log("JuckPot!!!!!!!!!");
                }
            }
            Main.AddBall();
        }
    }
Exemple #2
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name == "Sphere(Clone)")
     {
         Destroy(col.gameObject);
         Main.BallCount--;
         Main.AddBall();
     }
 }