Example #1
0
    private void ResetGame()
    {
        // Debug.Log("Game Reseted My PlayerID: " + _localPlayerIndex);
        _lockStepTurnID = firstLockStepTurnID;
        _pendingActions.Reset();
        _confirmedActions.Reset();
        _actionsToSend.Clear();

        _gameTurnSW.Reset();
        _currentGameFrameRuntime = 0;
        if (_networkRollingAverage == null)
        {
            _networkRollingAverage = new RollingAverage(_numberOfPlayers, _initialLockStepTurnLength);
        }
        else
        {
            _networkRollingAverage.Reset();
        }
        if (_runtimeRollingAverage == null)
        {
            _runtimeRollingAverage = new RollingAverage(_numberOfPlayers, _initialLockStepTurnLength);
        }
        else
        {
            _runtimeRollingAverage.Reset();
        }
    }