Exemple #1
0
    void WinCheck()
    {
        if (IsInStation())
        {
            if (Speed == 0 && !GameDone)
            {
                // HINT THAT THEY SHOULD USE THE PARKING BREAK
            }
        }
        if (nextStation.GetTrainInStart() && nextStation.GetTrainInEnd() && Speed == 0 && !GameDone && Gearbox.GetGear() == Gearbox.P)
        {
            if (NextStationID + 1 == Stations.Count)
            {
                Debug.Log("InWinState");
                GameDone = true;
                float timeUsed = Time.realtimeSinceStartup - TimeStarted;
                StationDone();
                Menu.ShowWin(MaxAccelerationScores, ParkingJobScores, TimingScores, ScanScores);
            }
            else
            {
                // score calc

                Menu.ShowMidWin(GetParkingScore(), GetConfortScore(), TimingScore(), scanScore, GetTimingText());

                //play a sound if the player just parked
                int level = FindObjectOfType <AudioManager2>().getLevel();
                if (level == 1 || level == 2)
                {
                    FindObjectOfType <AudioManager2>().Play("train", 2);
                }

                if (level == 3)
                {
                    FindObjectOfType <AudioManager2>().Play("train", 5);
                }

                // Debug.Log("setting bells false");
                //Stop playing bells if they are parked
                FindObjectOfType <AudioManager2>().setBells(false);

                StationDone();
                NextStation();
            }
            Playing = false;
        }
        if ((!nextStation.GetTrainInStart() || !nextStation.GetTrainInEnd()) && DistFromStation < 0)
        {
            Menu.ShowDieScreen();
            Playing = false;
        }
    }