void Start() { globalControl = GameObject.Find("GlobalControl").GetComponent <GlobalControl>(); score = globalControl.GetComponent <GlobalControl>().GetScore(); scorePrinted = new List <GameObject>(); scoreSprites = new List <Sprite>(); // Print current HighScore on screen //ResetHighScore(); highscore = PlayerPrefs.GetInt("highscore", highscore); PrintHighScore(); scorePrinted.Clear(); scoreSprites.Clear(); float tempX = scoreX; InstantiateLetters(firstLetterScore, tempX, scoreY, zero); tempX += none.rect.width; InstantiateLetters(secondLetterScore, tempX, scoreY, none); tempX += none.rect.width; InstantiateLetters(thirdLetterScore, tempX, scoreY, none); tempX += none.rect.width; InstantiateLetters(fourthLetterScore, tempX, scoreY, none); tempX += none.rect.width; InstantiateLetters(fifthLetterScore, tempX, scoreY, none); tempX += none.rect.width; InstantiateLetters(sixthLetterScore, tempX, scoreY, none); tempX += none.rect.width; }
void Start() { scoreManager = GameObject.Find("ScoreManager").GetComponent <ScoreManager>(); globalControl = GameObject.Find("GlobalControl").GetComponent <GlobalControl>(); lifesRemaining = globalControl.GetComponent <GlobalControl>().GetLifesRemaining(); gameOverSprite.GetComponent <Renderer>().enabled = false; continueSprite.GetComponent <Renderer>().enabled = false; initialPlayerPosition = player.transform.position; initialBallPosition = ball.transform.position; for (int i = lifesRemaining; i < maxLifes; i++) { lifes[i].SetActive(false); } }