mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
extended onCreateGame functionality
now also trips on object instances and datablock namespaces ensures there's a generic hook for post-load processing for objects created by a scene to reference other objects created during that process
This commit is contained in:
parent
bd2121b674
commit
cf56265789
1 changed files with 11 additions and 1 deletions
|
|
@ -139,7 +139,7 @@ function loadMissionStage3()
|
|||
|
||||
// Construct MOD paths
|
||||
pathOnMissionLoadDone();
|
||||
|
||||
getRootScene().callOnChildren("onCreateGame");
|
||||
// Mission loading done...
|
||||
echo("*** Mission loaded");
|
||||
|
||||
|
|
@ -152,6 +152,16 @@ function loadMissionStage3()
|
|||
%hasGameMode = callGamemodeFunction("onMissionStart");
|
||||
|
||||
}
|
||||
|
||||
function GameBase::onCreateGame(%this)
|
||||
{
|
||||
%db = %this.getDatablock();
|
||||
if (%db.isMethod("onCreateGame"))
|
||||
{
|
||||
%db.onCreateGame(%this);
|
||||
}
|
||||
}
|
||||
|
||||
function endMission()
|
||||
{
|
||||
if (!isObject( getScene(0) ))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue