void GetVaribles()
 {
     goalLine         = GameObject.Find("GoalLine");
     heightLine       = GameObject.Find("HeightLine");
     HeightLineScript = heightLine.GetComponent <HeightLine>();
     goalLineScript   = goalLine.GetComponent <GoalLine>();
     Speed            = HeightLineScript.upSpeed;
 }
Example #2
0
 void Getvaribles()
 {
     gameOverUIPrefab = GameObject.Find("Game Over");
     gameOverUIPrefab.transform.GetChild(0).gameObject.SetActive(true);
     heightLine       = GameObject.Find("HeightLine");
     heightLineScript = heightLine.GetComponent <HeightLine>();
     mainCamera       = GameObject.Find("Main Camera");
     mainCamera       = GameObject.FindGameObjectWithTag("Camera");
     camController    = mainCamera.gameObject.GetComponent <CameraController>();
     highScoreWords   = GameObject.Find("Blocks Placed Text").GetComponent <Text>();
     highScoreText    = GameObject.Find("High Score Text").GetComponent <Text>();
     newHighScoreText = GameObject.Find("New High Score Text").GetComponent <Text>();
     gameOverUIPrefab.transform.GetChild(0).gameObject.SetActive(false);
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        GetVaribles();
        heightScript = heightLine.GetComponent <HeightLine>();
        initalHeight = heightScript.initalHeight;
        goalHeight  += Random.Range(Mathf.Round(goalHeightMin), Mathf.Round(GoalHeightMax));

        if (GameData.ScreenWidth >= 10)
        {
            goalHeight += Random.Range(Mathf.Round(goalHeightMin), Mathf.Round(GoalHeightMax));
        }
        else
        {
            goalHeight += Random.Range(Mathf.Round(goalHeightMin / GameData.ScreenWidth), Mathf.Round(GameData.ScreenWidth));
        }

        SetLineHeight();
    }