Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionAttachToSlotManager.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to play animation on")]
5 ref SCR_ScenarioFrameworkGet m_ActorGetter;
6
7 [Attribute(desc: "Prop to be atteched")]
8 ref SCR_ScenarioFrameworkGet m_PropToAttachGetter;
9
10 [Attribute("")]
11 string m_sSlotName;
12
13 [Attribute("false", UIWidgets.Auto)]
14 bool m_bDetachAndDelete;
15
16 //------------------------------------------------------------------------------------------------
17 override void OnActivate(IEntity object)
18 {
19 if (!CanActivate())
20 return;
21
22 IEntity entity;
23 if (!ValidateInputEntity(object, m_ActorGetter, entity))
24 return;
25
26 IEntity propEntity;
27 if (!ValidateInputEntity(object, m_PropToAttachGetter, propEntity))
28 return;
29
30 SlotManagerComponent slotManager = SlotManagerComponent.Cast(entity.FindComponent(SlotManagerComponent));
31
32 if (!slotManager)
33 return;
34
35 EntitySlotInfo entityInSlot = slotManager.GetSlotByName(m_sSlotName);
36 if(!entityInSlot)
37 return;
38
39 if (!m_bDetachAndDelete)
40 entityInSlot.AttachEntity(propEntity);
41 else
42 {
43 IEntity entityToDetach = entityInSlot.GetAttachedEntity();
44
45 if (entityToDetach)
46 SCR_EntityHelper.DeleteEntityAndChildren(entityToDetach);
47 }
48 }
49}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Adds ability to attach an object to a slot.
proto external Managed FindComponent(typename typeName)
SCR_FieldOfViewSettings Attribute