protected override void OnCreate()
        {
            base.OnCreate();

            _simulationWorldSystem = World.GetOrCreateSystem <SimulationWorldSystem>();
            _tickSystem            = World.GetOrCreateSystem <TickSimulationSystem>();
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            SimWorldAccessor = ExternalSimWorldAccessorInstantiationFunc();
            World.GetOrCreateSystem <LoadSimulationSceneSystem>();
            _tickSystem = World.GetOrCreateSystem <TickSimulationSystem>();

            RequestReplaceSimWorld(CreateNewReplacementWorld());
        }
Пример #3
0
        protected override void OnCreate()
        {
            base.OnCreate();

            _session = OnlineService.ServerInterface.SessionServerInterface;
            _session.RegisterNetMessageReceiver <NetMessageRequestSimSync>(OnSimSyncRequest);

            _simWorldSystem      = World.GetOrCreateSystem <SimulationWorldSystem>();
            _tickSystem          = World.GetOrCreateSystem <TickSimulationSystem>();
            _constructTickSystem = World.GetOrCreateSystem <ConstructSimulationTickSystem>();
        }
Пример #4
0
        protected override void OnCreate()
        {
            base.OnCreate();

            _session = OnlineService.ClientInterface.SessionClientInterface;

            _tickSystem        = World.GetOrCreateSystem <TickSimulationSystem>();
            _simWorldSystem    = World.GetOrCreateSystem <SimulationWorldSystem>();
            _receiveTickSystem = World.GetOrCreateSystem <ReceiveSimulationTickSystem>();

            _requestSync = true;
        }
Пример #5
0
        // !! CONSIDER SPLITING THIS SYSTEM IN TWO (one for load, one for save)!!

        protected override void OnCreate()
        {
            base.OnCreate();

#if DEBUG
            s_commandInstance = this;
            GameConsole.SetCommandOrVarEnabled("Sim.SaveToMemory", true);
            GameConsole.SetCommandOrVarEnabled("Sim.SaveToFile", true);
            GameConsole.SetCommandOrVarEnabled("Sim.LoadFromMemory", true);
            GameConsole.SetCommandOrVarEnabled("Sim.LoadFromFile", true);
#endif

            _simulationWorldSystem = World.GetOrCreateSystem <SimulationWorldSystem>();
            _tickSystem            = World.GetOrCreateSystem <TickSimulationSystem>();
        }
        //private SpaceTimeDebugger.Clock _debugClock;
        //private SpaceTimeDebugger.Stream _debugStreamQueueLength;
        //private SpaceTimeDebugger.Stream _debugStreamTicksPerFrame;
        //private SpaceTimeDebugger.Stream _debugStreamMaxQueueDuration;

        protected override void OnCreate()
        {
            base.OnCreate();

            _session = OnlineService.OnlineInterface?.SessionInterface;

            if (_session == null)
            {
                throw new NullReferenceException();
            }

            if (!_session.IsClientType)
            {
                throw new Exception($"{nameof(ReceiveSimulationTickSystem)} expects the session interface to be of type 'Client'.");
            }

            _session.RegisterNetMessageReceiver <NetMessageSimTick>(OnNetMessageSimTick);

            _tickSystem = World.GetOrCreateSystem <TickSimulationSystem>();

            //_debugStreamQueueLength = SpaceTimeDebugger.CreateStream("Sim Tick Queue", Color.yellow);
            //_debugStreamTicksPerFrame = SpaceTimeDebugger.CreateStream("Sim Ticks Per Frame", Color.magenta);
            //_debugStreamMaxQueueDuration = SpaceTimeDebugger.CreateStream("Sim Tick Queue Max Duration", Color.cyan);
        }