4 protected bool m_bUpdating =
false;
5 protected ref array<SCR_NotificationsComponent> m_Components = {};
6 protected ref array<SCR_NotificationsComponent> m_DeletedComponents = {};
8 override protected void OnUpdate(ESystemPoint point)
10 float timeSlice = GetWorld().GetTimeSlice();
14 foreach (SCR_NotificationsComponent comp: m_Components)
16 comp.Update(timeSlice);
21 foreach (SCR_NotificationsComponent comp: m_DeletedComponents)
25 m_DeletedComponents.Clear();
28 override protected void OnDiag(
float timeSlice)
30 DbgUI.Begin(
"NotificationsSystem");
32 DbgUI.Text(
"Items: " + m_Components.Count());
34 if (DbgUI.Button(
"Dump active components"))
36 foreach (SCR_NotificationsComponent comp: m_Components)
38 Print(comp.GetOwner(), LogLevel.ERROR);
45 void Register(SCR_NotificationsComponent component)
48 if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
51 if (m_Components.Find(component) != -1)
54 m_Components.Insert(component);
57 void Unregister(SCR_NotificationsComponent component)
59 int idx = m_Components.Find(component);
64 m_DeletedComponents.Insert(component);
66 m_Components.Remove(idx);