8 int m_iRepetitionCount;
18 [
Attribute(
"", UIWidgets.Object,
"Time settings")]
19 ref array<ref SCR_SoundBellTime> m_aSoundBellTime;
22 private int m_iTimeOfDaySignalIdx;
24 private const float TRIGGER_INTERVAL = 850;
26 protected float m_fTimer;
27 protected float m_fTimeOfDayValueLast;
29 protected int m_iBellTimeIdx = -1;
30 protected int m_iSoundBellTimeCount;
31 protected int m_iRepetitionCount;
33 private float m_fWorldTimeLast;
36 override void UpdateSoundJob(IEntity owner,
float timeSlice)
39 float worldTime = owner.GetWorld().GetWorldTime();
41 if (m_fWorldTimeLast == worldTime)
44 float dt = worldTime - m_fWorldTimeLast;
45 float timeOfDay = m_GameSignalManager.GetSignalValue(m_iTimeOfDaySignalIdx) * 24;
78 if (m_iBellTimeIdx == - 1)
82 for (
int i = 0; i < m_iSoundBellTimeCount; i++)
93 if (m_aSoundBellTime[m_iBellTimeIdx].
m_fBellTime < timeOfDay && m_aSoundBellTime[m_iBellTimeIdx].
m_fBellTime >= m_fTimeOfDayValueLast)
101 m_fTimeOfDayValueLast = timeOfDay;
102 m_fWorldTimeLast = worldTime;
106 override void OnUpdateSoundJobBegin(IEntity owner)
108 m_fTimeOfDayValueLast = m_GameSignalManager.GetSignalValue(m_iTimeOfDaySignalIdx) * 24;
114 override void OnPostInit(IEntity owner)
116 super.OnPostInit(owner);
119 SetEventMask(owner, EntityEvent.INIT);
123 override void OnInit(IEntity owner)
126 m_iSoundBellTimeCount = m_aSoundBellTime.Count();
129 if (m_iSoundBellTimeCount == 0)
136 m_GameSignalManager =
GetGame().GetSignalsManager();
138 m_iTimeOfDaySignalIdx = m_GameSignalManager.AddOrFindSignal(
"TimeOfDay");