Exemplo n.º 1
0
        protected override void OnCreate()
        {
            var rpcSystem = World.GetOrCreateSystem <RpcSystem>();

            rpcSystem.RegisterRpc <TActionSerializer, TActionRequest>();

            _rpcQueue = rpcSystem.GetRpcQueue <TActionSerializer, TActionRequest>();
            _barrier  = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();

            requestRpcQuery = GetEntityQuery(
                ComponentType.ReadOnly <SendRpcCommandRequestComponent>(),
                ComponentType.ReadOnly <TActionRequest>());
        }
Exemplo n.º 2
0
        protected override void OnCreate()
        {
            if (World.GetExistingSystem <ServerSimulationSystemGroup>() != null)
            {
                DriverConstructor.CreateServerDriver(World, out Driver, out _unreliablePipeline, out _reliablePipeline);
            }
            else
            {
                DriverConstructor.CreateClientDriver(World, out Driver, out _unreliablePipeline, out _reliablePipeline);
            }

            _driverListening = false;
            _rpcQueue        = World.GetOrCreateSystem <RpcSystem>().GetRpcQueue <RpcSetNetworkId, RpcSetNetworkId>();
            _barrier         = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();
        }