protected override void OnCreateManager(int capacity)
        {
            base.OnCreateManager(capacity);

            worker = WorkerRegistry.GetWorkerForWorld(World);
            view   = worker.View;

            GenerateComponentGroups();
        }
示例#2
0
        public static void SetWorkerForWorld(WorkerBase worker)
        {
            if (WorldToWorker.ContainsKey(worker.World))
            {
                throw new ArgumentException($"A worker is already stored for world '{worker.World.Name}'");
            }

            WorldToWorker[worker.World] = worker;
        }
示例#3
0
        public static void UnsetWorkerForWorld(WorkerBase worker)
        {
            WorkerBase workerForWorld;

            if (WorldToWorker.TryGetValue(worker.World, out workerForWorld) && workerForWorld == worker)
            {
                WorldToWorker.Remove(worker.World);
            }
        }
示例#4
0
        protected override void OnCreateManager(int capacity)
        {
            base.OnCreateManager(capacity);

            worker = WorkerRegistry.GetWorkerForWorld(World);
            view   = worker.View;

            dispatcher = new Dispatcher();
            SetupDispatcherHandlers();
        }
        protected override void OnCreateManager(int capacity)
        {
            base.OnCreateManager(capacity);

            worker = WorkerRegistry.GetWorkerForWorld(World);

            spatialOSSendSystem = World.GetOrCreateManager <SpatialOSSendSystem>();
            if (!spatialOSSendSystem.TryRegisterCustomReplicationSystem(typeof(T)))
            {
                worker.View.LogDispatcher.HandleLog(LogType.Error, new LogEvent(CustomReplicationSystemAlreadyExists)
                                                    .WithField(LoggingUtils.LoggerName, LoggerName)
                                                    .WithField("ComponentType", typeof(T)));
            }
        }