MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / SetAttachmentEffect

Method SetAttachmentEffect

Code/CryEngine/CryEntitySystem/ScriptBind_Entity.cpp:2161–2186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2159}
2160
2161int CScriptBind_Entity::SetAttachmentEffect(IFunctionHandler* pH, int characterSlot, const char* attachmentName, const char* effectName, Vec3 offset, Vec3 dir, float scale, int flags)
2162{
2163 GET_ENTITY;
2164
2165 ICharacterInstance* pCharacter = pEntity->GetCharacter(characterSlot);
2166
2167 if (!pCharacter)
2168 {
2169 return pH->EndFunction();
2170 }
2171
2172 IAttachmentManager* pIAttachmentManager = pCharacter->GetIAttachmentManager();
2173 IAttachment* pIAttachment = pIAttachmentManager->GetInterfaceByName(attachmentName);
2174
2175 if (!pIAttachment)
2176 {
2177 return pH->EndFunction();
2178 }
2179
2180 CEffectAttachment* pEffectAttachment = new CEffectAttachment(effectName, offset, dir, scale);
2181
2182 pIAttachment->AddBinding(pEffectAttachment);
2183 pIAttachment->HideAttachment(0);
2184
2185 return pH->EndFunction();
2186}
2187
2188//////////////////////////////////////////////////////////////////////////
2189int CScriptBind_Entity::SetAttachmentObject(IFunctionHandler* pH, int characterSlot, const char* attachmentName, ScriptHandle entityId, int slot, int flags)

Callers

nothing calls this directly

Calls 5

GetInterfaceByNameMethod · 0.80
AddBindingMethod · 0.80
GetCharacterMethod · 0.45
EndFunctionMethod · 0.45
HideAttachmentMethod · 0.45

Tested by

no test coverage detected