예제 #1
0
    public void CompleteLevel()
    {
        //set new PBs
        LevelStats pb;
        LevelStats comparer = new LevelStats();

        //set the global PB to be the new PB if better
        pb = GlobalManager.Instance.LevelCompletionStats[LevelNumber]["PB"];
        pb = LevelStats.GetLowest(pb, currentStats, ref comparer);

        //play animation for improved pb categories
        if (comparer.Time > 0)
        {
        }
        if (comparer.BlocksCollected.Collected > 0)
        {
        }
        if (comparer.BlocksUsed > 0)
        {
        }

        //check the rankings of the new PB
        LevelRanking pbRanking = pb.GetLevelRanking(GlobalManager.Instance.LevelCompletionStats[LevelNumber]);

        //display animations for rankings

        //Save Game
        GlobalManager.Instance.SaveGame();
    }
예제 #2
0
    public void MoreCollected(LevelStats l1, LevelStats l2)
    {
        Debug.Log("l2 collected more blocks than l1");

        LevelStats comparer = new LevelStats();
        LevelStats newpb    = LevelStats.GetLowest(l1, l2, ref comparer);

        if (comparer.Time < 0 && comparer.BlocksUsed < 0 && comparer.BlocksCollected.Collected > 0)
        {
            Debug.Log("Comparer results correct");
        }
        else
        {
            Debug.Log("Comparer results correct");
        }

        if (newpb.Time == l1.Time && newpb.BlocksUsed == l1.BlocksUsed && newpb.BlocksCollected.Collected == l2.BlocksCollected.Collected)
        {
            Debug.Log("Properties match");
        }
        else
        {
            Debug.Log("Property mismatch");
        }
    }