Exemple #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);
     }
 }
    public void setState(int x)
    {
        state = GameObject.Find("AnyText").GetComponent <Text> ();
        end   = GameObject.Find("EndText").GetComponent <Text> ();
        BrickController bc = new BrickController();

        end.text   = "";
        state.text = "";
        if (x >= 1)
        {
            state.text = "LIFE: " + (x).ToString();
        }
        else if (x == 0)
        {
            end.fontSize = 8;
            end.text     = "GAME OVER!";
            state.text   = "Score:" + bc.getScore().ToString();
            StartCoroutine(End(bc.getScore()));
        }
        else if (x == -1)
        {
            end.fontSize = 8;
            end.text     = "YOU WON!!!";
            StartCoroutine(End(bc.getScore()));
        }
        else if (x == -2)
        {
            end.fontSize = 8;
            end.text     = "TIME IS UP!";
            state.text   = "Score:" + bc.getScore().ToString();
            StartCoroutine(End(bc.getScore()));
        }
    }