Ejemplo n.º 1
0
        public void SFEXT_L_EntityStart()
        {
            var             entity    = GetComponentInParent <SaccEntity>();
            SaccVehicleSeat pilotSeat = null;

            foreach (var seat in entity.gameObject.GetComponentsInChildren <SaccVehicleSeat>(true)) // ToDo: Workarond on U# 0.x
            {
                if ((bool)seat.GetProgramVariable("IsPilotSeat"))
                {
                    pilotSeat = seat;
                    break;
                }
            }

            transceiver = pilotSeat.GetComponentInChildren <Transceiver>(true);
            var transmitter = transceiver.transmitter;

            if (transmitter.indicator)
            {
                txIndicator = transmitter.indicator;
            }
            else
            {
                transmitter.indicator = Dial_Funcon;
            }

            var enabledTrigger = pilotSeat.GetComponentInChildren <TransceiverEnabledTrigger>(true);

            if (enabledTrigger)
            {
                enabledTrigger.defaultTransmit = false;
            }

            foreach (var touchSwitch in entity.gameObject.GetComponentsInChildren <TouchSwitch>(true)) // ToDo: Workarond on U# 0.x
            {
                if (touchSwitch.eventTarget == transceiver && touchSwitch.eventName == nameof(Transceiver._ToggleTransmit))
                {
                    touchSwitch.enableDesktopKey = false;
                }
            }
        }