14 if (!AttachedEntityInvoker)
16 return AttachedEntityInvoker;
20 if (!DetachedEntityInvoker)
22 return DetachedEntityInvoker;
35 array<Managed> 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 = {};
52 foreach (Managed managed : slots)
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 = {};
99 foreach (Managed managed : slotComponents)
104 slotInfos.Insert(slotInfo);
108 array<Managed> weaponSlotComponents = {};
110 foreach (Managed managed : weaponSlotComponents)
115 slotInfos.Insert(slotInfo);
121 proto external
IEntity GetAttachedEntity();
123 proto external
string GetSourceName();
129 proto external
void SetAdditiveTransformLS(
vector matLS[4]);
134 proto external
void OverrideTransformLS(
vector matLS[4]);
139 proto external
void DetachEntity(
bool physicalChange =
true);
145 proto external
void AttachEntity(
IEntity entity);
150 event void OnAttachedEntity(
IEntity entity) {
if (AttachedEntityInvoker) AttachedEntityInvoker.Invoke(entity); };
152 event void OnDetachedEntity(
IEntity entity) {
if (DetachedEntityInvoker) DetachedEntityInvoker.Invoke(entity); };