3 protected bool m_bUpdating =
false;
4 protected ref array<SCR_GadgetComponent> m_Components = {};
5 protected ref array<SCR_GadgetComponent> m_DeletedComponents = {};
8 protected override void OnUpdate(ESystemPoint point)
10 float timeSlice = GetWorld().GetTimeSlice();
14 foreach (SCR_GadgetComponent comp: m_Components)
16 comp.Update(timeSlice);
21 foreach (SCR_GadgetComponent comp: m_DeletedComponents)
25 m_DeletedComponents.Clear();
29 protected override void OnDiag(
float timeSlice)
31 DbgUI.Begin(
"GadgetsSystem");
33 DbgUI.Text(
"Items: " + m_Components.Count());
35 if (DbgUI.Button(
"Dump active components"))
37 foreach (SCR_GadgetComponent comp: m_Components)
39 Print(comp.GetOwner(), LogLevel.ERROR);
48 void Register(SCR_GadgetComponent component)
51 if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
54 if (m_Components.Find(component) != -1)
57 m_Components.Insert(component);
61 void Unregister(SCR_GadgetComponent component)
63 int idx = m_Components.Find(component);
68 m_DeletedComponents.Insert(component);
70 m_Components.Remove(idx);