Esempio n. 1
0
    // 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();
    }
Esempio n. 2
0
        // 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++;
        }
Esempio n. 3
0
 void Start()
 {
     levelCharacteristics = UIManager.GetComponent <LevelCharacteristics>();
 }