MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / removeComponent

Method removeComponent

Engine/source/T3D/entity.cpp:1251–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1249//////////////////////////////////////////////////////////////////////////
1250
1251bool Entity::removeComponent(Component *comp, bool deleteComponent)
1252{
1253 if (comp == NULL)
1254 return false;
1255
1256 if(mComponents.remove(comp))
1257 {
1258 AssertFatal(comp->isProperlyAdded(), "Don't know how but a component is not registered w/ the sim");
1259
1260 //setComponentsDirty();
1261
1262 onComponentRemoved.trigger(comp);
1263
1264 comp->setOwner(NULL);
1265
1266 comp->onComponentRemove(); //in case the behavior needs to do cleanup on the owner
1267
1268 if (deleteComponent)
1269 comp->safeDeleteObject();
1270
1271 return true;
1272 }
1273
1274 return false;
1275}
1276
1277//////////////////////////////////////////////////////////////////////////
1278//NOTE:

Callers 3

entity.cppFile · 0.80
onRemoveMethod · 0.80
setOwnerMethod · 0.80

Calls 6

isProperlyAddedMethod · 0.80
safeDeleteObjectMethod · 0.80
removeMethod · 0.45
triggerMethod · 0.45
setOwnerMethod · 0.45
onComponentRemoveMethod · 0.45

Tested by

no test coverage detected