Esempio n. 1
0
        protected override void OnCreate()
        {
            _interpolatedDespawnQueue = new NativeQueue <DelayedDespawnGhost>(Allocator.Persistent);
            _predictedDespawnQueue    = new NativeQueue <DelayedDespawnGhost>(Allocator.Persistent);

            _networkTimeSystem  = World.GetOrCreateSystem <NetworkTimeSystem>();
            _ghostReceiveSystem = World.GetOrCreateSystem <GhostReceiveSystem>();
            _barrier            = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();
        }
Esempio n. 2
0
        protected override void OnCreate()
        {
            RequireSingletonForUpdate <NetworkSnapshotAckComponent>();
            RequireSingletonForUpdate <GhostPrefabCollectionComponent>();

            _ghostCollectionSystem = World.GetOrCreateSystem <GhostCollectionSystem>();
            _delayedSpawnQueue     = new NativeQueue <DelayedSpawnGhost>(Allocator.Persistent);
            _ghostRecvSystem       = World.GetOrCreateSystem <GhostReceiveSystem>();
            _networkTimeSystem     = World.GetOrCreateSystem <NetworkTimeSystem>();
        }
Esempio n. 3
0
        protected override void OnCreate()
        {
            base.OnCreate();
            SortSystems();

            isServer = World.GetExistingSystem <ClientSimulationSystemGroup>() == null;
            if (!isServer)
            {
                _networkTimeSystem = World.GetOrCreateSystem <NetworkTimeSystem>();
            }
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            _networkTime = World.GetOrCreateSystem <NetworkTimeSystem>();

            _ghostQuery = GetEntityQuery(
                ComponentType.Exclude <GhostPredictionComponent>(),
                ComponentType.ReadWrite <GhostComponent>(),
                ComponentType.ReadWrite <SnapshotData>(),
                ComponentType.ReadWrite <SnapshotDataBuffer>());

            RequireSingletonForUpdate <NetworkStreamInGame>();
        }
        protected override void OnCreate()
        {
            var ent = EntityManager.CreateEntity();

            EntityManager.AddComponentData(ent, default(PredictedGhostSpawnList));
            EntityManager.AddBuffer <PredictedGhostSpawn>(ent);

            RequireSingletonForUpdate <PredictedGhostSpawnList>();

            _ghostInitQuery = GetEntityQuery(ComponentType.ReadOnly <PredictedGhostSpawnRequestComponent>(),
                                             ComponentType.ReadWrite <GhostComponent>());
            _ghostQuery = GetEntityQuery(ComponentType.ReadWrite <GhostComponent>(),
                                         ComponentType.ReadOnly <PredictedGhostSpawnPendingComponent>());

            _barrier                    = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();
            _networkTimeSystem          = World.GetOrCreateSystem <NetworkTimeSystem>();
            _ghostCollectionSystem      = World.GetOrCreateSystem <GhostCollectionSystem>();
            _ghostPredictionSystemGroup = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
        }