Пример #1
0
 public void initialize()
 {
     tipRead = new bool[30];
     levels  = new List <IndLevel> ();
     for (int i = 0; i < 18; i++)
     {
         IndLevel ind = new IndLevel();
         ind.unlocked      = false;
         ind.amountOfStars = 0;
         ind.score         = 0f;
         if (i == 0)
         {
             ind.unlocked = true;
             //ind.amountOfStars = 3;
         }
         levels.Add(ind);
     }
 }
Пример #2
0
    public void EndLevel()
    {
        //This does scoring and score submission;
        IndLevel lev   = GameDataManger.manager.levelData.levels [levelNumber];
        float    score = level.score;

        //Debug.Log (level.score);
        if (level.infiniteMode)
        {
            score = level.timeElapsed;
            int potentialStars = 0;
            if (score > lev.score)
            {
                if (score >= scoreThresh3StarInf)
                {
                    potentialStars = 3;
                }
                else if (score >= scoreThresh2StarInf)
                {
                    potentialStars = 2;
                }
                else if (score >= scoreThresh1StarInf)
                {
                    potentialStars = 1;
                }
                else
                {
                    potentialStars = 0;
                }
                scoreToSubmit = score;
                QueryHighScoreSubmission();
            }
            if (potentialStars > lev.amountOfStars)
            {
                lev.amountOfStars = potentialStars;
            }
            if (lev.amountOfStars > 0)
            {
                GameDataManger.manager.ShowTip(20);
            }
        }
        else
        {
            if (score > lev.score)
            {
                lev.score = score;
                if (score >= scoreThresh4Star)
                {
                    lev.amountOfStars = 4;
                }
                else if (score >= scoreThresh3Star)
                {
                    lev.amountOfStars = 3;
                }
                else if (score >= scoreThresh2Star)
                {
                    lev.amountOfStars = 2;
                }
                else if (score >= scoreThresh1Star)
                {
                    lev.amountOfStars = 1;
                }
                else
                {
                    lev.amountOfStars = 0;
                }
            }
            if (score == 0f)
            {
                if (GameDataManger.manager.settings.currentMat == 5)
                {
                    GameDataManger.manager.UnlockWithMessage(0, 5, GameDataManger.manager.modelUnlockText, "Again...? For your tenacity, you've been awarded the 'Void' playermodel. Head over to the 'Models' tab to enjoy your 'success'...");
                }
                GameDataManger.manager.UnlockWithMessage(1, 5, GameDataManger.manager.matUnlockText, "You beat a level with 0 score... That's actually kind of hard to pull off. You've been awarded the 'Void' skin.");
            }
            else if (score == 1f)
            {
                if (GameDataManger.manager.unlockData.modelUnlocks[1])
                {
                    GameDataManger.manager.UnlockWithMessage(0, 2, GameDataManger.manager.matUnlockText, "What an overachiever! For recieving a 100% score AGAIN, you've been awarded the Eggplant playermodel");
                }
                GameDataManger.manager.UnlockWithMessage(0, 1, GameDataManger.manager.modelUnlockText, "Baller! For beating a level with a 100% score, you've unlocked the Banana playermodel. Head over to the 'models' tab of the 'extras' menu to equip it");
            }
        }
        if (lev.amountOfStars > 0 && levelNumber < 17)
        {
            GameDataManger.manager.levelData.levels [levelNumber + 1].unlocked = true;
        }
        GameDataManger.manager.SaveLevelData();
        CheckForUnlocks();
    }