mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
add reload status to onNewDataBlock callback
and skip calling onremove/onadd if we're not reloading
This commit is contained in:
parent
2852b33cec
commit
2ae10c7ce1
28 changed files with 35 additions and 37 deletions
|
|
@ -78,17 +78,15 @@ function spawnGameObject(%name, %addToScene)
|
|||
return 0;
|
||||
}
|
||||
|
||||
function GameBaseData::onNewDataBlock(%this, %obj)
|
||||
function GameBaseData::onNewDataBlock(%this, %obj, %reload)
|
||||
{
|
||||
if (%obj.firstDataCheck)
|
||||
if (%reload)
|
||||
{
|
||||
if(%this.isMethod("onRemove"))
|
||||
%this.onRemove(%obj);
|
||||
if(%this.isMethod("onAdd"))
|
||||
%this.onAdd(%obj);
|
||||
}
|
||||
else
|
||||
%obj.firstDataCheck = true;
|
||||
}
|
||||
|
||||
function saveGameObject(%name, %tamlPath, %scriptPath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue