mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-05 21:40:31 +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
|
|
@ -125,6 +125,11 @@ IMPLEMENT_CALLBACK( GameBase, setControl, void, ( bool controlled ), ( controlle
|
|||
"client controls this object.\n" );
|
||||
|
||||
|
||||
IMPLEMENT_CALLBACK(GameBase, onAdd, void, (SimObjectId ID), (ID),
|
||||
"Called when this ScriptObject is added to the system.\n"
|
||||
"@param ID Unique object ID assigned when created (%this in script).\n"
|
||||
);
|
||||
|
||||
GameBaseData::GameBaseData()
|
||||
{
|
||||
mCategory = StringTable->EmptyString();
|
||||
|
|
@ -518,6 +523,7 @@ void GameBase::scriptOnAdd()
|
|||
// everything is ready.
|
||||
if (mDataBlock && !isGhost())
|
||||
mDataBlock->onAdd_callback( this );
|
||||
onAdd_callback(getId());
|
||||
}
|
||||
|
||||
void GameBase::scriptOnNewDataBlock(bool reload)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue