// Use this for initialization void Start() { TotalCoinsText.text = PlayerPrefs.GetInt("TotalCoins").ToString(); cameraScroll = cam.GetComponent <CameraScroll>(); pauseLevel = UIManager.GetComponent <PauseLevel>(); timerScript = UIManager.GetComponent <TimerScript>(); //advertismentScript = UIManager.GetComponent<AdvertisementScript>(); muteAudio = UIManager.GetComponent <MuteAudio>(); levelCharacteristics = UIManager.GetComponent <LevelCharacteristics>(); if (levelCharacteristics.isGravitySwitch) { jumpDirection = Vector2.left; levelCharacteristics.GravitySwitch(); } coinArray = GameObject.FindGameObjectsWithTag("Coin"); coinListLength = coinArray.Length; for (int x = 0; x < coinListLength; x++) { coinList.Add(coinArray[x]); } playerPosition = player.transform.position; camPosition = cam.transform.position; music.Pause(); }
// Load level and all it's dependencies. private void LoadLevel( ) { int numLetters = LevelCharacteristics.GetLevelNumberOfLetters(levelCounter); int numWords = LevelCharacteristics.GetLevelNumberOfWords(levelCounter); float time = LevelCharacteristics.GetLevelTime(levelCounter); string[] words = wordFileReader.ReadSpecificFileAndGetRandomWords(LevelCharacteristics.GetLevelNumberOfWords(levelCounter), LevelCharacteristics.GetLevelNumberOfLetters(levelCounter)); levelManager.InitializeLevel(words, numWords, numLetters, time); textManager.SetLevelWords(words); textManager.UpdateShowingWord( ); levelCounter++; }
void Start() { levelCharacteristics = UIManager.GetComponent <LevelCharacteristics>(); }