Exemplo n.º 1
0
 // Update is called once per frame
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Pick Up1") || other.gameObject.CompareTag("Pick Up2") || other.gameObject.CompareTag("Pick Up3") ||
     other.gameObject.CompareTag("Pick Up4") || other.gameObject.CompareTag("Pick Up5"))
     {
        // StartCoroutine(Do(other));
         other.gameObject.SetActive(false);
         other.gameObject.transform.position = new Vector3(Random.Range(-10.0f, 10.0f), 0.5f, Random.Range(-10.0f, 10.0f));
         other.gameObject.SetActive(true);
         puntos++;
         Debug.Log(puntos + " " + this.name);
         if(this.name == "Player 1")
         {
             puntaje.setPuntaje1(puntos);
         }
         else
         {
             puntaje.setPuntaje2(puntos);
         }
         Prediction pred = new Prediction();
         int select = pred.start(Distance());
         mover(select);
     }
 }