3 private BaseLightManagerComponent m_pLightManager;
4 private ref array<BaseLightSlot> m_aLightSlots = {};
6 override void OnInit(IEntity pOwnerEntity, GenericComponent pManagerComponent)
8 super.OnInit(pOwnerEntity, pManagerComponent);
10 IEntity parent = pOwnerEntity;
11 while (parent && !m_pLightManager)
13 m_pLightManager = BaseLightManagerComponent.Cast(parent.FindComponent(BaseLightManagerComponent));
14 parent = parent.GetParent();
22 array<BaseLightSlot> lights = {}; m_pLightManager.GetLights(lights);
26 if (scrLightSlot && name.Compare(scrLightSlot.GetHitZoneName(),
false) == 0)
27 m_aLightSlots.Insert(lightSlot);
33 override void OnDamageStateChanged()
35 super.OnDamageStateChanged();
40 void UpdateLightState()
42 bool isAlive = GetDamageState() !=
EDamageState.DESTROYED;
49 lightSlot.SetLightFunctional(isAlive);
54 surfaceID = lightSlot.GetSurfaceID();
56 m_pLightManager.TrySetSurfaceFunctional(surfaceID, isAlive);
62 m_aLightSlots.Clear();