3 protected ref array<SCR_FuelConsumptionComponent> m_Components = {};
5 protected override void OnUpdate(ESystemPoint point)
7 float timeSlice = GetWorld().GetFixedTimeSlice();
9 foreach (SCR_FuelConsumptionComponent comp: m_Components)
11 comp.Update(timeSlice);
16 protected override void OnDiag(
float timeSlice)
18 DbgUI.Begin(
"FuelConsumptionSystem");
20 DbgUI.Text(
"Items: " + m_Components.Count());
22 if (DbgUI.Button(
"Dump active components"))
24 foreach (SCR_FuelConsumptionComponent comp: m_Components)
26 Print(comp.GetOwner(), LogLevel.ERROR);
35 void Register(SCR_FuelConsumptionComponent component)
38 if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
41 if (m_Components.Find(component) != -1)
44 m_Components.Insert(component);
48 void Unregister(SCR_FuelConsumptionComponent component)
50 int idx = m_Components.Find(component);
54 m_Components.Remove(idx);