Exemple #1
0
    private void Awake()
    {
        var dependencyContainer = new DependencyContainer(new Dictionary <string, object> {
            { "clock", _syncedGameClock },
            { "fixedClock", _syncedFixedClock },
        });

        var prefabs = new Dictionary <ObjectType, GameObject> {
            { ObjectTypes.Player, _playerPrefab },
        };

        _ramnet       = new RamnetBase(_coroutineScheduler, _transporter, _natFacilitatorEndpoint.ToIpEndPoint(), _messageTransporter, prefabs, dependencyContainer);
        _pongMessages = _ramnet.MessagePool.GetPool <BasicMessage.Pong>();
        _replicator   = new Replicator(_ramnet.ReplicatedObjectStore);
    }
Exemple #2
0
    private void Awake()
    {
        //_gameClock.TimeScale = 0f;

        _updatePlayerPacketsReceived = new CircularBuffer <double>(500);
        var dependencyContainer = new DependencyContainer(new Dictionary <string, object> {
            { "clock", _synchedGameClock },
            { "fixedClock", _syncedFixedClock },
            { "updatePlayerPacketsCounter", _updatePlayerPacketsReceived }
        });

        var prefabs = new Dictionary <ObjectType, GameObject> {
            { ObjectTypes.Player, _playerPrefab },
        };

        _ramnet       = new RamnetBase(_coroutineScheduler, _transporter, _natFacilitatorEndpoint.ToIpEndPoint(), _messageTransporter, prefabs, dependencyContainer);
        _pingMessages = _ramnet.MessagePool.GetPool <BasicMessage.Ping>();
    }