Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkAIActionToggleLights.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "1", desc: "Set lights on")]
5 bool m_bSetLightsOn;
6
7 [Attribute(defvalue: "0", desc: "Set light lense")]
8 int m_iLensID;
9
10 //------------------------------------------------------------------------------------------------
11 override void OnActivate()
12 {
13 super.OnActivate();
14
15 array<AIAgent> agents = {};
16 m_AIGroup.GetAgents(agents);
17
18 IEntity agentEntity;
19 foreach (AIAgent agent : agents)
20 {
21 agentEntity = agent.GetControlledEntity();
22 if (agentEntity)
23 ProcessEntity(agentEntity);
24 }
25 }
26
27 //------------------------------------------------------------------------------------------------
28 protected void ProcessEntity(IEntity agentEntity)
29 {
30 SCR_FlashlightComponent flashlightComp;
31 flashlightComp = SCR_FlashlightComponent.Cast(agentEntity.FindComponent(SCR_FlashlightComponent));
32 if (flashlightComp)
33 {
34 flashlightComp.OnToggleActive(m_bSetLightsOn);
35
36 for (int i = 0; i < m_iLensID; i++) {
37 flashlightComp.CycleThroughLenses(true);
38 }
39 }
40
41 IEntity child = agentEntity.GetChildren();
42 while (child)
43 {
44 ProcessEntity(child);
45 child = child.GetSibling();
46 }
47 }
48}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto external IEntity GetChildren()
proto external IEntity GetSibling()
override void OnToggleActive(bool state)
void CycleThroughLenses(bool direction)
SCR_FieldOfViewSettings Attribute