private void OnOperationalChanged(object data)
        {
            var isOn = (bool)data;

            UpdateVisualState(isOn);
            WirelessAutomationManager.SetEmitterSignal(_emitterId, isOn);
        }
        protected override void OnSpawn()
        {
            OnOperationalChanged(operational.IsOperational);
            base.OnSpawn();

            _emitterId = WirelessAutomationManager.RegisterEmitter(new SignalEmitter(EmitChannel, operational.IsOperational));
        }
Beispiel #3
0
        private void OnLogicEventChanged(object data)
        {
            var signal = ((LogicValueChanged)data).newValue;

            UpdateVisualState(signal > 0);
            WirelessAutomationManager.SetEmitterSignal(_emitterId, signal);
        }
Beispiel #4
0
        protected override void OnSpawn()
        {
            _receiverId = WirelessAutomationManager.RegisterReceiver(new SignalReceiver(ReceiveChannel, gameObject));

            UpdateVisualState(Signal > 0);
            _logicPorts.SendSignal(LogicSwitch.PORT_ID, Signal);

            Subscribe(WirelessAutomationManager.WirelessLogicEvent, OnWirelessLogicEventChanged);
        }
        public void Sim200ms(float dt)
        {
            var signal = WirelessAutomationManager.GetSignalForChannel(ReceiveChannel);

            if (IsSwitchedOn != signal)
            {
                ChangeState(signal);
            }
        }
 private void ChangeEmitChannel(int channel)
 {
     EmitChannel = channel;
     WirelessAutomationManager.ChangeEmitterChannel(_emitterId, EmitChannel);
 }
 protected override void OnCleanUp()
 {
     base.OnCleanUp();
     Unsubscribe((int)GameHashes.OperationalChanged, OnOperationalChanged);
     WirelessAutomationManager.UnregisterEmitter(_emitterId);
 }
 public static void Postfix(PauseScreen __instance)
 {
     WirelessAutomationManager.ResetEmittersList();
     WirelessAutomationManager.ResetReceiversList();
 }
Beispiel #9
0
 protected override void OnSpawn()
 {
     _emitterId = WirelessAutomationManager.RegisterEmitter(new SignalEmitter(EmitChannel, _logicPorts.GetInputValue(LogicSwitch.PORT_ID)));
 }
Beispiel #10
0
 private void ChangeListeningChannel(int channel)
 {
     ReceiveChannel = channel;
     WirelessAutomationManager.ChangeReceiverChannel(_receiverId, ReceiveChannel);
 }
Beispiel #11
0
 protected override void OnCleanUp()
 {
     Unsubscribe((int)GameHashes.OperationalChanged, OnWirelessLogicEventChanged);
     WirelessAutomationManager.UnregisterReceiver(_receiverId);
 }