Exemplo n.º 1
0
 void OnCollisionEnter(Collision collision)                          //faz a pedra parar de se mover
 {
     peixinho.GetComponent <movimentopeixinho>().selecionalane(1);
     control.GetComponent <scenecontroller>().freeze = true;
     txt4.SetActive(true);
     button2.SetActive(true);
     button3.SetActive(true);
     txt1.SetActive(false);
     txt2.SetActive(false);
     txt3.SetActive(false);
     Lanes.SetActive(false);
     peixinho.GetComponent <movimentopeixinho>().speed /= 7;
 }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (move == true)
     {
         transform.position = Vector3.MoveTowards(transform.position, new Vector3(-1.33f, y, -1.0f), speed * Time.deltaTime);
         if (Vector3.Distance(transform.position, new Vector3(-1.33f, y, -1.0f)) < 0.001f)
         {
             move = false;
         }
     }
     if (tiralane)
     {
         tempo += Time.deltaTime;
         if (tempo > 0.5f)
         {
             Lanes.SetActive(false);
             tiralane = false;
             tempo    = 0f;
         }
     }
 }