protected override void OnCreate() { m_NewGhosts = new NativeList <T>(16, Allocator.Persistent); m_NewGhostIds = new NativeList <int>(16, Allocator.Persistent); m_Archetype = GetGhostArchetype(); m_PredictedArchetype = GetPredictedGhostArchetype(); m_InitialArchetype = EntityManager.CreateArchetype(ComponentType.ReadWrite <T>(), ComponentType.ReadWrite <ReplicatedEntityComponent>()); m_GhostMap = World.GetOrCreateSystem <GhostReceiveSystemGroup>().GhostEntityMap; m_ConcurrentGhostMap = m_GhostMap.AsParallelWriter(); m_SpawnRequestGroup = GetEntityQuery(ComponentType.ReadOnly <T>(), ComponentType.ReadOnly <PredictedSpawnRequestComponent>()); m_InvalidGhosts = new NativeList <Entity>(1024, Allocator.Persistent); m_DelayedSpawnQueue = new NativeQueue <DelayedSpawnGhost>(Allocator.Persistent); m_CurrentDelayedSpawnList = new NativeList <DelayedSpawnGhost>(1024, Allocator.Persistent); m_ConcurrentDelayedSpawnQueue = m_DelayedSpawnQueue.AsParallelWriter(); m_PredictedSpawnQueue = new NativeQueue <DelayedSpawnGhost>(Allocator.Persistent); m_CurrentPredictedSpawnList = new NativeList <DelayedSpawnGhost>(1024, Allocator.Persistent); m_ConcurrentPredictedSpawnQueue = m_PredictedSpawnQueue.AsParallelWriter(); m_Barrier = World.GetOrCreateSystem <EndSimulationEntityCommandBufferSystem>(); m_PredictSpawnGhosts = new NativeList <PredictSpawnGhost>(16, Allocator.Persistent); m_PredictionSpawnCleanupMap = new NativeHashMap <int, int>(16, Allocator.Persistent); m_TimeSystem = World.GetOrCreateSystem <NetworkTimeSystem>(); }
protected override void OnCreate() { m_ReceiveSystem = World.GetOrCreateSystem <NetworkStreamReceiveSystem>(); m_TimeSystem = World.GetOrCreateSystem <NetworkTimeSystem>(); }