예제 #1
0
파일: Main.cs 프로젝트: avimatt/Carmony
    // Display end game screen from the team that finished
    public void endGame(bool isTop)
    {
        foreach(GameObject go in Map.GetComponent<Map>().fireworkList)
        {
            go.SetActive(true);
        }
        scoreRow newRow = new scoreRow();
        if (isTop)
        {
            newRow.setName(carTop.GetComponent<CarState>().name);
            carTopDone = true;
            CarmonyGUI.S.topMinimap.SetActive(false);
            CarmonyGUI.S.topMinimapDots.SetActive(false);
            CarmonyGUI.S.topImageLeft.SetActive(false);
            CarmonyGUI.S.topImageRight.SetActive(false);
            carTop.GetComponent<CarState>().totalTime = getGameTime();
            CarmonyGUI.S.HideTopPowerUpActivator();
            CarmonyGUI.S.topSpeedBox.gameObject.SetActive(false);
            CarmonyGUI.S.topSpeedSlider.gameObject.SetActive(false);
            CarmonyGUI.S.topSpeed.SetActive(false);
            CarmonyGUI.S.topLap.SetActive(false);
        }
        else
        {
            newRow.setName(carBottom.GetComponent<CarState>().name);
            CarmonyGUI.S.bottomMinimap.SetActive(false);
            CarmonyGUI.S.bottomMinimapDots.SetActive(false);
            CarmonyGUI.S.bottomImageLeft.SetActive(false);
            CarmonyGUI.S.bottomImageRight.SetActive(false);
            carBottom.GetComponent<CarState>().totalTime = getGameTime();
            carBottomDone = true;
            CarmonyGUI.S.HideBottomPowerUpActivator();
            CarmonyGUI.S.bottomSpeedBox.gameObject.SetActive(false);
            CarmonyGUI.S.bottomSpeedSlider.gameObject.SetActive(false);
            CarmonyGUI.S.bottomSpeed.SetActive(false);
            CarmonyGUI.S.bottomLap.SetActive(false);
        }
        Logger.S.printSummary(isTop);
        CarmonyGUI.S.endGame(isTop);

        int minutes = Int32.Parse(getGameTime().Substring(0, 1));
        int seconds = Int32.Parse(getGameTime().Substring(2, 2));
        newRow.setTime(minutes, seconds);
        HighScores.S.updateList(newRow);
    }
예제 #2
0
 void readFile()
 {
     scoreList.Clear();
     StreamReader theReader = new StreamReader(Main.S.Map.GetComponent<Map>().name + filename, Encoding.Default);
     using (theReader)
     {
         string line;
         do
         {
             line = theReader.ReadLine();
             if (line != null && line != "")
             {
                 string[] entries = line.Split(' ');
                 scoreRow newRow = new scoreRow();
                 newRow.setPlace(Int32.Parse(entries[0]));
                 newRow.setName(entries[1]);
                 newRow.setTime(Int32.Parse(entries[2]), Int32.Parse(entries[3]));
                 scoreList.Add(newRow);
             }
         } while (line != null);
     }
 }