示例#1
0
    public void Start()
    {
        myMenuManager = GetComponentInParent <MenuGeneric>();

        SaveDataScript.Load();

        // find the last completed level and get its index when completing a level
        if (!DisplayOnly)
        {
            //Debug.Log("x");
            levelIndex = GetLevelIndex(SaveDataScript.MySaveData.LastCompletedLevel);
            if (levelIndex < 0)
            {
                // create a new level dataset
                AddLevelDataset(SaveDataScript.MySaveData.LastCompletedLevel);
                levelIndex = GetLevelIndex(SaveDataScript.MySaveData.LastCompletedLevel);
            }
        }
        else
        {
            levelIndex = GetLevelIndex(selectedLevel);
        }

        //sort the level's data set
        //Debug.Log(SaveDataScript.MySaveData.levelScoreDataSet.Count);
        if (levelIndex < SaveDataScript.MySaveData.levelScoreDataSet.Count && levelIndex >= 0)
        {
            //Debug.Log("y");
            SaveDataScript.MySaveData.levelScoreDataSet[levelIndex].scoreDataset.Sort(SortFunc);


            if (!DisplayOnly)
            {
                //Debug.Log("Z");
                CheckAddScore();
            }
            displayText.text = DisplayScores();
        }
    }
示例#2
0
    //float counter = 0;

    // Start is called before the first frame update
    void Start()
    {
        myMenu = GetComponentInChildren <MenuGeneric>();
        myMenu.ShowPanel(myMenu.FirstPanel.name);
    }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     myMenu = GetComponentInChildren <MenuGeneric>();
 }