Ejemplo n.º 1
0
        public override void OnReceiveRemote(ElevatorMessage message)
        {
            DebugLog.DebugWrite($"Get ElevatorMessage {message.Direction} for {message.ObjectId}");
            var elevator = WorldRegistry.GetObject <QSBElevator>(message.ObjectId);

            elevator?.RemoteCall(message.Direction);
        }
Ejemplo n.º 2
0
 private void OnSceneLoaded(OWScene scene, bool isInUniverse)
 {
     _elevators = Resources.FindObjectsOfTypeAll <Elevator>().ToList();
     for (var id = 0; id < _elevators.Count; id++)
     {
         var qsbElevator = WorldRegistry.GetObject <QSBElevator>(id) ?? new QSBElevator();
         qsbElevator.Init(_elevators[id], id);
         WorldRegistry.AddObject(qsbElevator);
     }
 }
        private void OnSceneLoaded(OWScene scene, bool isInUniverse)
        {
            var geyserControllers = Resources.FindObjectsOfTypeAll <GeyserController>();

            for (var id = 0; id < geyserControllers.Length; id++)
            {
                var qsbGeyser = WorldRegistry.GetObject <QSBGeyser>(id) ?? new QSBGeyser();
                qsbGeyser.Init(geyserControllers[id], id);
                WorldRegistry.AddObject(qsbGeyser);
            }
        }
Ejemplo n.º 4
0
        private void OnSceneLoaded(OWScene scene, bool isInUniverse)
        {
            var sectors = Resources.FindObjectsOfTypeAll <Sector>().ToList();

            for (var id = 0; id < sectors.Count; id++)
            {
                var qsbSector = WorldRegistry.GetObject <QSBSector>(id) ?? new QSBSector();
                qsbSector.Init(sectors[id], id);
                WorldRegistry.AddObject(qsbSector);
            }
            IsReady = WorldRegistry.GetObjects <QSBSector>().Any();
        }
        public override void OnReceiveRemote(WorldObjectMessage message)
        {
            if (!QSBSceneManager.IsInUniverse)
            {
                return;
            }
            var sector = WorldRegistry.GetObject <QSBSector>(message.ObjectId);

            if (sector == null)
            {
                DebugLog.ToConsole($"Sector with order id {message.ObjectId} not found!", MessageType.Warning);
                return;
            }

            var transformSync = PlayerRegistry.GetSyncObject <TransformSync>(message.AboutId);

            QSB.Helper.Events.Unity.RunWhen(() => transformSync.SyncedTransform != null,
                                            () => transformSync.SetReferenceSector(sector));
        }
        public override void OnReceiveRemote(GeyserMessage message)
        {
            var geyser = WorldRegistry.GetObject <QSBGeyser>(message.ObjectId);

            geyser?.SetState(message.State);
        }