3 protected IEntity m_vehicleEnt;
5 [
Attribute(
"0", UIWidgets.ComboBox,
"Light Type: ",
"", ParamEnumArray.FromEnum(
ELightType) )]
8 [
Attribute(
"0", UIWidgets.CheckBox,
"Enabled: ")]
9 protected bool m_bEnabled;
11 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
13 if (!GetVariableIn(
"VehicleIn", m_vehicleEnt))
14 return ENodeResult.FAIL;
17 if (!GetVariableIn(
"EnabledIn", bEnabled))
20 Vehicle vehicle = Vehicle.Cast(m_vehicleEnt);
22 return ENodeResult.FAIL;
24 BaseLightManagerComponent vehicleLightManagerComp = BaseLightManagerComponent.Cast(vehicle.FindComponent(BaseLightManagerComponent));
25 if (!vehicleLightManagerComp)
26 return ENodeResult.FAIL;
28 vehicleLightManagerComp.SetLightsState(m_eLightType, bEnabled);
30 return ENodeResult.SUCCESS;
33 protected static ref TStringArray s_aVarsIn = {
34 "VehicleIn",
"EnabledIn"
36 override TStringArray GetVariablesIn()
41 override bool VisibleInPalette()
46 override string GetOnHoverDescription()
48 return "Toggles the state of lights in a vehicle";