4 protected string m_sHitZoneName;
6 [
Attribute(defvalue:
"", uiwidget: UIWidgets.EditBox,
desc:
"Name of the sound event that should be called when the lights are activated.",
category:
"Sounds")]
7 protected string m_sLightOnEventName;
9 [
Attribute(defvalue:
"", uiwidget: UIWidgets.EditBox,
desc:
"Name of the sound event that should be called when the lights are deactivated.",
category:
"Sounds")]
10 protected string m_sLightOffEventName;
12 protected bool m_bIsActive;
13 protected SoundComponent m_SoundComponent;
15 protected ref ScriptInvoker m_OnLightStateChanged;
20 ScriptInvoker GetOnLightStateChanged()
22 if (!m_OnLightStateChanged)
23 m_OnLightStateChanged =
new ScriptInvoker();
25 return m_OnLightStateChanged;
29 override void OnLightStateChanged(
bool newState)
35 if (m_OnLightStateChanged)
36 m_OnLightStateChanged.Invoke(newState);
40 override void OnInit(IEntity owner)
46 GetOnLightStateChanged().Insert(PlaySound);
51 void PlaySound(
bool newState)
56 eventName = m_sLightOnEventName;
58 eventName = m_sLightOffEventName;
66 string GetHitZoneName()
68 return m_sHitZoneName;