mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
trip onadd in additional places
by request, adds a per object-instance onadd for datablocks if an object instance *also* defines a class. be mindful not to mix up which namespace is in use there, as you can not tag two different core class instances the same scripted class implements the same with the same restrictions for simobjects in general
This commit is contained in:
parent
0fb68936f9
commit
4f639a16b5
4 changed files with 25 additions and 0 deletions
|
|
@ -88,6 +88,16 @@ EndImplementBitfieldType;
|
|||
|
||||
IMPLEMENT_CONOBJECT( SimObject );
|
||||
|
||||
IMPLEMENT_CALLBACK(SimObject, onAdd, void, (SimObjectId ID), (ID),
|
||||
"Called when this SimObject is added to the system, if the className is set to something\n"
|
||||
"@param ID Unique object ID assigned when created (%this in script).\n"
|
||||
);
|
||||
|
||||
IMPLEMENT_CALLBACK(SimObject, onRemove, void, (SimObjectId ID), (ID),
|
||||
"Called when this SimObject is removed from the system, if the className is set to something\n"
|
||||
"@param ID Unique object ID assigned when created (%this in script).\n"
|
||||
);
|
||||
|
||||
// See full description in the new CHM manual
|
||||
ConsoleDocClass( SimObject,
|
||||
"@brief Base class for almost all objects involved in the simulation.\n\n"
|
||||
|
|
@ -1689,6 +1699,8 @@ bool SimObject::onAdd()
|
|||
|
||||
linkNamespaces();
|
||||
|
||||
onAdd_callback(getId());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1698,6 +1710,8 @@ void SimObject::onRemove()
|
|||
{
|
||||
mFlags.clear(Added);
|
||||
|
||||
onRemove_callback(getId());
|
||||
|
||||
unlinkNamespaces();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue