Exemplo n.º 1
0
 void Update()
 {
     if (!fbc.Visible())
     {
         BrickController bc = new BrickController();
         int             y  = GameObject.Find("Ball").GetComponent <BallController> ().getLife();
         int             z  = GameObject.Find("TimeText").GetComponent <Timer> ().getTime();
         if (bc.getScore() == 50 || (y == 2 && bc.getScore() == 200) || z == 10)
         {
             yapayZeka.transform.position = new Vector3(0.0f, 0.0f, 22.0f);
             isVisible(true);
         }
         if (yapayZeka.transform.position.z <= 3.0f)
         {
             Vector3 x = new Vector3(yapayZeka.transform.position.x, yapayZeka.transform.position.y, -3.0f);
             yapayZeka.destination = x;
         }
         else
         {
             yapayZeka.destination = player.transform.position;
         }
     }
     if (fbc.Visible())
     {
         isVisible(false);
     }
 }
Exemplo n.º 2
0
 void Update()
 {
     if (!fbc.Visible())
     {
         float h = horizontalSpeed * Input.GetAxis("Mouse X");
         transform.Translate(0, -h, 0);
         rb.position = new Vector3(
             Mathf.Clamp(rb.position.x, boundary.xMin, boundary.xMax),
             0.0f,
             0.0f
             );
     }
 }
Exemplo n.º 3
0
    void Update()
    {
        if (!fbc.Visible())
        {
            player = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody>();

            if (!isStart)
            {
                rb.isKinematic     = false;
                player.isKinematic = false;
                rb.position        = player.transform.position + new Vector3(0, 0, 1.0f);
            }

            if (Input.GetMouseButtonDown(0))
            {
                rb.AddForce(0, 0, 300f);
                isStart = true;
            }

            if (rb.position.z < 0)
            {
                fbc.setVisible(true);
                tmp();
            }
        }
    }
Exemplo n.º 4
0
 void Update()
 {
     if (!fbc.Visible())
     {
         countdownTo -= Time.deltaTime;
         if (countdownTo > 0)
         {
             countdownText.text = "" + (int)countdownTo;
         }
         else
         {
             fbc.setVisible(true);
             fbc.setState(-2);
         }
     }
 }