コード例 #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>();
        }
コード例 #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>();
        }
コード例 #3
0
        protected override void OnCreate()
        {
            base.OnCreate();
            SortSystems();

            isServer = World.GetExistingSystem <ClientSimulationSystemGroup>() == null;
            if (!isServer)
            {
                _networkTimeSystem = World.GetOrCreateSystem <NetworkTimeSystem>();
            }
        }
コード例 #4
0
        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>();
        }
コード例 #5
0
        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>();
        }