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)));
            }
        }
예제 #2
0
        protected override void OnCreateManager()
        {
            base.OnCreateManager();

            WorkerSystem = World.GetExistingManager <WorkerSystem>();

            spatialOSSendSystem = World.GetOrCreateManager <SpatialOSSendSystem>();

            var component = new T();

            if (!spatialOSSendSystem.TryRegisterCustomReplicationSystem(component.ComponentId))
            {
                WorkerSystem.LogDispatcher.HandleLog(LogType.Error, new LogEvent(CustomReplicationSystemAlreadyExists)
                                                     .WithField(LoggingUtils.LoggerName, LoggerName)
                                                     .WithField("ComponentType", typeof(T)));
            }
        }
예제 #3
0
 public void SendCommands(SpatialOSSendSystem sendSystem, Connection connection)
 {
     Profiler.BeginSample("SendCommands");
     Handler.SendCommands(sendSystem, connection);
     Profiler.EndSample();
 }
예제 #4
0
 public void Execute(SpatialOSSendSystem sendSystem, Connection connection)
 {
     Handler.ExecuteReplication(ReplicationComponentGroup, connection);
     Handler.SendCommands(sendSystem, connection);
 }