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>(); }
protected override void OnCreate() { if (World.GetExistingSystem <ServerSimulationSystemGroup>() != null) { DriverConstructor.CreateServerDriver(World, out m_Driver, out m_UnreliablePipeline, out m_ReliablePipeline); } else { DriverConstructor.CreateClientDriver(World, out m_Driver, out m_UnreliablePipeline, out m_ReliablePipeline); } m_ConcurrentDriver = m_Driver.ToConcurrent(); m_DriverListening = false; m_Barrier = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>(); numNetworkIds = new NativeArray <int>(1, Allocator.Persistent); freeNetworkIds = new NativeQueue <int>(Allocator.Persistent); rpcQueue = World.GetOrCreateSystem <RpcSystem>().GetRpcQueue <RpcSetNetworkId>(); m_NetworkStreamConnectionQuery = EntityManager.CreateEntityQuery(typeof(NetworkStreamConnection)); #if UNITY_EDITOR || DEVELOPMENT_BUILD m_NetStats = new NativeArray <uint>(1, Allocator.Persistent); m_GhostStatsCollectionSystem = World.GetOrCreateSystem <GhostStatsCollectionSystem>(); #endif }