14 if (!AttachedEntityInvoker)
16 return AttachedEntityInvoker;
20 if (!DetachedEntityInvoker)
22 return DetachedEntityInvoker;
30 IEntity parent = entity.GetParent();
35 array<Managed> slotManagers = {};
36 parent.FindComponents(SlotManagerComponent, slotManagers);
37 foreach (Managed managed : slotManagers)
39 SlotManagerComponent slotManager = SlotManagerComponent.Cast(managed);
40 array<EntitySlotInfo> managerSlotInfos = {};
41 slotManager.GetSlotInfos(managerSlotInfos);
44 if (slotInfo && slotInfo.GetAttachedEntity() == entity)
50 array<Managed> slots = {};
51 parent.FindComponents(BaseSlotComponent, slots);
52 foreach (Managed managed : slots)
54 BaseSlotComponent slot = BaseSlotComponent.Cast(managed);
56 if (slotInfo && slotInfo.GetAttachedEntity() == entity)
61 array<Managed> weaponSlots = {};
63 foreach (Managed managed : weaponSlots)
67 if (slotInfo && slotInfo.GetAttachedEntity() == entity)
79 static void GetSlotInfos(notnull IEntity entity, inout notnull array<EntitySlotInfo> slotInfos)
82 array<Managed> slotManagers = {};
83 entity.FindComponents(SlotManagerComponent, slotManagers);
84 foreach (Managed managed : slotManagers)
86 SlotManagerComponent slotManager = SlotManagerComponent.Cast(managed);
87 array<EntitySlotInfo> managerSlotInfos = {};
88 slotManager.GetSlotInfos(managerSlotInfos);
92 slotInfos.Insert(slotInfo);
97 array<Managed> slotComponents = {};
98 entity.FindComponents(BaseSlotComponent, slotComponents);
99 foreach (Managed managed : slotComponents)
101 BaseSlotComponent slot = BaseSlotComponent.Cast(managed);
104 slotInfos.Insert(slotInfo);
108 array<Managed> weaponSlotComponents = {};
110 foreach (Managed managed : weaponSlotComponents)
115 slotInfos.Insert(slotInfo);
119 proto external
bool IsEnabled();
121 proto external IEntity GetAttachedEntity();
123 proto external
string GetSourceName();
128 proto external
void SetAdditiveTransformLS(vector matLS[4]);
133 proto external
void OverrideTransformLS(vector matLS[4]);
138 proto external
void DetachEntity(
bool physicalChange =
true);
144 proto external
void AttachEntity(IEntity entity);
149 event void OnAttachedEntity(IEntity entity) {
if (AttachedEntityInvoker) AttachedEntityInvoker.Invoke(entity); };
151 event void OnDetachedEntity(IEntity entity) {
if (DetachedEntityInvoker) DetachedEntityInvoker.Invoke(entity); };