// Use this for initialization void Start () { lblStyle.fontSize = 24; lblStyle.alignment = TextAnchor.MiddleCenter; HighScoreScript hsScript = (HighScoreScript) gameObject.GetComponent(typeof(HighScoreScript)); //hsScript.Save(); // This will reset highscores hsScript.Load(); highScore1 = hsScript.highScores.highscore1; highScore2 = hsScript.highScores.highscore2; highScore3 = hsScript.highScores.highscore3; highScore4 = hsScript.highScores.highscore4; highScore5 = hsScript.highScores.highscore5; scrollStarted = false; scrollXValue = 0; AdHandlerScript.showBanner(); }
// Use this for initialization void Start () { /*GameObject carObject = GameObject.Find ("Player"); if (carObject != null) { SpriteRenderer carSprite = carObject.GetComponent<SpriteRenderer>(); if(carSprite != null) { if(SelectedLevelScript.selectedCar == 1) carSprite.sprite = Resources.Load<UnityEngine.Sprite>("car2"); else if(SelectedLevelScript.selectedCar == 2) carSprite.sprite = Resources.Load<UnityEngine.Sprite>("rallycar"); } }*/ HighScoreScript hsScript = (HighScoreScript) gameObject.GetComponent(typeof(HighScoreScript)); //hsScript.Save(); // This will reset highscores hsScript.Load(); obstacleIndex = 0; obstacleCount = 0; iteration = 0; startTimer = 0; videoAdToBeShown = false; interstitialToBeShown = false; float screenAspect = (float)Screen.width / (float)Screen.height; float cameraHeight = Camera.main.orthographicSize * 2; stage_bounds = new Bounds( Camera.main.transform.position, new Vector3(cameraHeight * screenAspect, cameraHeight, 0)); CreateObstacles (); showingNumber = 4; easyPort = true; prevObstacle = 0; }