コード例 #1
0
ファイル: ScoreDisplay.cs プロジェクト: GLovett19/NeonHighway
    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>();
 }