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

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

            GenerateComponentGroups();
        }
Example #2
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)));
            }
        }
Example #4
0
        protected WorkerBase(string workerId, Vector3 origin, ILogDispatcher loggingDispatcher)
        {
            if (string.IsNullOrEmpty(workerId))
            {
                throw new ArgumentException("WorkerId is null or empty.", nameof(workerId));
            }

            WorkerId = workerId;
            World    = new World(WorkerId);
            WorkerRegistry.SetWorkerForWorld(this);

            View   = new MutableView(World, loggingDispatcher);
            Origin = origin;

            EntityGameObjectLinker = new EntityGameObjectLinker(World, View);
        }
Example #5
0
        protected WorkerBase(string workerId, Vector3 origin, ILogDispatcher loggingDispatcher)
        {
            if (string.IsNullOrEmpty(workerId))
            {
                WorkerId = GenerateDynamicWorkerId();

                UseDynamicId = true;
            }
            else
            {
                WorkerId = workerId;
            }

            World = new World(WorkerId);
            WorkerRegistry.SetWorkerForWorld(this);

            View   = new MutableView(World, loggingDispatcher);
            Origin = origin;

            EntityGameObjectLinker = new EntityGameObjectLinker(World, View);
        }
Example #6
0
 public void Dispose()
 {
     WorkerRegistry.UnsetWorkerForWorld(this);
     View.Dispose();
     World.Dispose();
 }