3 protected SCR_RadioComponent m_RadioComp;
6 override bool CanBeShownScript(IEntity user)
11 CharacterControllerComponent charComp = CharacterControllerComponent.Cast(user.FindComponent(CharacterControllerComponent));
12 return charComp.GetInspect();
15 protected override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
17 if (CanBePerformed(pUserEntity))
18 m_RadioComp.RadioToggle();
24 if (!m_RadioComp.GetRadioComponent().IsPowered())
25 soundMan.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent.SOUND_ITEM_RADIO_TOGGLE_ON);
27 soundMan.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent.SOUND_ITEM_RADIO_TOGGLE_OFF);
30 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
32 m_RadioComp = SCR_RadioComponent.Cast(pOwnerEntity.FindComponent(SCR_RadioComponent));
35 override bool HasLocalEffectOnlyScript()
40 override bool GetActionNameScript(out
string outName)
42 if (m_RadioComp.GetRadioComponent().IsPowered())
43 outName =
"#AR-UserAction_TurnOff";
45 outName =
"#AR-UserAction_TurnOn";