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));
        }
Пример #3
0
        private void OnLogicEventChanged(object data)
        {
            var signal = ((LogicValueChanged)data).newValue;

            UpdateVisualState(signal > 0);
            WirelessAutomationManager.SetEmitterSignal(_emitterId, signal);
        }
Пример #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);
 }
Пример #8
0
 public static void Postfix(PauseScreen __instance)
 {
     WirelessAutomationManager.ResetEmittersList();
     WirelessAutomationManager.ResetReceiversList();
 }
Пример #9
0
 protected override void OnSpawn()
 {
     _emitterId = WirelessAutomationManager.RegisterEmitter(new SignalEmitter(EmitChannel, _logicPorts.GetInputValue(LogicSwitch.PORT_ID)));
 }
Пример #10
0
 private void ChangeListeningChannel(int channel)
 {
     ReceiveChannel = channel;
     WirelessAutomationManager.ChangeReceiverChannel(_receiverId, ReceiveChannel);
 }
Пример #11
0
 protected override void OnCleanUp()
 {
     Unsubscribe((int)GameHashes.OperationalChanged, OnWirelessLogicEventChanged);
     WirelessAutomationManager.UnregisterReceiver(_receiverId);
 }