示例#1
0
    void LevelFinished(bool outOfTime = false)
    {
        if (!gameStarted)
        {
            return;
        }

        Debug.Log("NL" + nextLevel + " : " + currentLevel);
        if ((outOfTime || nextLevel) && currentLevel < _Levels.Length)
        {
            ClearLevel();
            // Hard coded to 3
            levels[currentLevel - 1] = 3;
            if (!devMode)
            {
                PlayFabManager.instance.SetLevelInfo(levels);
            }

            levelCompleteUI.Show(outOfTime);
            Tile[] tiles = currentLevelGameObject.GetComponentsInChildren <Tile>();
            foreach (Tile t in tiles)
            {
                t.LevelComplete();
            }
        }

        if (currentLevel >= _Levels.Length)
        {
            ClearLevel();
            gameUI.AddScore();
            Debug.Log("Finished");
            gameOverUI.gameObject.SetActive(true);
        }
    }
示例#2
0
 public void AddScore(int amount)       // Get Score whenever you slice a ball
 {
     gameUI.AddScore(amount);
 }