Пример #1
0
    public void CheckAddScore()
    {
        //Debug.Log("A");

        // get the score from the previously completed level
        try
        {
            //Debug.Log("B1");
            newScoreData.scoreValue = FindObjectOfType <AppManager>().scorePasser;
        }
        catch
        {
            //Debug.Log("B2");
            Debug.Log("Couldnt find Preload Scene app manager, using Test Score");
            try
            {
                newScoreData.scoreValue = SaveDataScript.MySaveData.levelScoreDataSet[levelIndex].scoreDataset[0].scoreValue + 1;
            }
            catch
            {
                newScoreData.scoreValue = 1;
            }
        }

        //check if the scoreboard is full andwether or not the player should be allowed to add their score to the board.
        if (SaveDataScript.MySaveData.levelScoreDataSet[levelIndex].scoreDataset.Count >= displayNum)
        {
            // Debug.Log("C1");
            if (newScoreData.scoreValue > SaveDataScript.MySaveData.levelScoreDataSet[levelIndex].scoreDataset[SaveDataScript.MySaveData.levelScoreDataSet[levelIndex].scoreDataset.Count - 1].scoreValue)
            {
                //Debug.Log("D");
                myMenuManager.ShowPanel("CharacterInput");
            }
        }
        else
        {
            // Debug.Log("C2");
            myMenuManager.ShowPanel("CharacterInput");
        }
    }
Пример #2
0
    //float counter = 0;

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