コード例 #1
0
        /// <summary>
        /// Reset all player entries for restarting a game.
        /// In derived classes reset all the variables we need to reset for
        /// a new game there (e.g. car speed in CarController or
        /// cameraWobbel in ChaseCamera).
        /// </summary>
        public virtual void Reset()
        {
            //*** Initialize the high scores

            Highscores.Initialize();

            levelNum   = TrackSelection.SelectedTrackNumber;
            isGameOver = false;
            alreadyUploadedHighscore    = false;
            currentGameTimeMilliseconds = 0;
            bestLapTimeMilliseconds     = 0;
            lap        = 0;
            victory    = false;
            zoomInTime = StartGameZoomTimeMilliseconds;
            firstFrame = true;

            m_LapId = Guid.NewGuid().ToString();

            CurrentLapData = new LapData()
            {
                PlayerName    = GameSettings.Default.PlayerName,
                CarType       = RacingGameManager.currentCarNumber,
                LapId         = m_LapId,
                GameStartTime = DateTime.UtcNow,
                Level         = levelNum
            };
        }