mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Initial implementation of the Scene object for handling scenes/levels in a more consistent and deliberate way.
This commit is contained in:
parent
e0627973fb
commit
1c2f90a190
37 changed files with 509 additions and 140 deletions
|
|
@ -18,7 +18,7 @@ function Core_ClientServer::create( %this )
|
|||
exec( "./scripts/client/client.cs" );
|
||||
exec( "./scripts/server/server.cs" );
|
||||
|
||||
$Game::MissionGroup = "MissionGroup";
|
||||
$Game::MainScene = getScene(0);
|
||||
|
||||
initServer();
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ function sendLoadInfoToClient( %client )
|
|||
function parseMissionGroup( %className, %childGroup )
|
||||
{
|
||||
if( getWordCount( %childGroup ) == 0)
|
||||
%currentGroup = "MissionGroup";
|
||||
%currentGroup = getScene(0);
|
||||
else
|
||||
%currentGroup = %childGroup;
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ function parseMissionGroup( %className, %childGroup )
|
|||
function parseMissionGroupForIds( %className, %childGroup )
|
||||
{
|
||||
if( getWordCount( %childGroup ) == 0)
|
||||
%currentGroup = $Game::MissionGroup;
|
||||
%currentGroup = getScene(0);
|
||||
else
|
||||
%currentGroup = %childGroup;
|
||||
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ function loadMissionStage2()
|
|||
// Exec the mission. The MissionGroup (loaded components) is added to the ServerGroup
|
||||
exec(%file);
|
||||
|
||||
if( !isObject(MissionGroup) )
|
||||
if( !isObject(getScene(0)) )
|
||||
{
|
||||
$Server::LoadFailMsg = "No 'MissionGroup' found in mission \"" @ %file @ "\".";
|
||||
$Server::LoadFailMsg = "No Scene found in level \"" @ %file @ "\".";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ function loadMissionStage2()
|
|||
|
||||
function endMission()
|
||||
{
|
||||
if (!isObject( MissionGroup ))
|
||||
if (!isObject( getScene(0) ))
|
||||
return;
|
||||
|
||||
echo("*** ENDING MISSION");
|
||||
|
|
@ -159,7 +159,7 @@ function endMission()
|
|||
}
|
||||
|
||||
// Delete everything
|
||||
MissionGroup.delete();
|
||||
getScene(0).delete();
|
||||
MissionCleanup.delete();
|
||||
|
||||
clearServerPaths();
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ function onServerDestroyed()
|
|||
{
|
||||
physicsStopSimulation("server");
|
||||
|
||||
if (!isObject( MissionGroup ))
|
||||
if (!isObject( getScene(0) ))
|
||||
return;
|
||||
|
||||
echo("*** ENDING MISSION");
|
||||
|
|
@ -262,7 +262,7 @@ function onServerDestroyed()
|
|||
}
|
||||
|
||||
// Delete everything
|
||||
MissionGroup.delete();
|
||||
getScene(0).delete();
|
||||
MissionCleanup.delete();
|
||||
|
||||
clearServerPaths();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue