Torque 3D - Script Manual: GameBaseData Class Reference

TorqueScript

Main   Class List   Namespace List   Online

GameBaseData Class Reference
[Game Objects]

Scriptable, demo-able datablock. Used by GameBase objects. More...

Inheritance diagram for GameBaseData:

List of all members.

Public Member Functions

Callbacks

void onAdd (GameBase obj)
 Called when the object is added to the scene.
void onMount (GameBase obj, SceneObject mountObj, int node)
 Called when the object is mounted to another object in the scene.
void onNewDataBlock (GameBase obj)
 Called when the object has a new datablock assigned.
void onRemove (GameBase obj)
 Called when the object is removed from the scene.
void onUnmount (GameBase obj, SceneObject mountObj, int node)
 Called when the object is unmounted from another object in the scene.

Public Attributes

Scripting

caseString category
 The group that this datablock will show up in under the "Scripted" tab in the World Editor Library.

Detailed Description

Scriptable, demo-able datablock. Used by GameBase objects.

See also:
GameBase

Member Function Documentation

void GameBaseData::onAdd ( GameBase  obj  ) 

Called when the object is added to the scene.

Parameters:
obj the GameBase object
Example:
datablock GameBaseData(MyObjectData)
{
   category = "Misc";
};

function MyObjectData::onAdd( %this, %obj )
{
   echo( "Added " @ %obj.getName() @ " to the scene." );
}

function MyObjectData::onNewDataBlock( %this, %obj )
{
   echo( "Assign " @ %this.getName() @ " datablock to " %obj.getName() );
}

function MyObjectData::onRemove( %this, %obj )
{
   echo( "Removed " @ %obj.getName() @ " to the scene." );
}

function MyObjectData::onMount( %this, %obj, %mountObj, %node )
{
   echo( %obj.getName() @ " mounted to " @ %mountObj.getName() );
}

function MyObjectData::onUnmount( %this, %obj, %mountObj, %node )
{
   echo( %obj.getName() @ " unmounted from " @ %mountObj.getName() );
}
void GameBaseData::onMount ( GameBase  obj,
SceneObject  mountObj,
int  node 
)

Called when the object is mounted to another object in the scene.

Parameters:
obj the GameBase object being mounted
mountObj the object we are mounted to
node the mountObj node we are mounted to
See also:
onAdd for an example
void GameBaseData::onNewDataBlock ( GameBase  obj  ) 

Called when the object has a new datablock assigned.

Parameters:
obj the GameBase object
See also:
onAdd for an example
void GameBaseData::onRemove ( GameBase  obj  ) 

Called when the object is removed from the scene.

Parameters:
obj the GameBase object
See also:
onAdd for an example
void GameBaseData::onUnmount ( GameBase  obj,
SceneObject  mountObj,
int  node 
)

Called when the object is unmounted from another object in the scene.

Parameters:
obj the GameBase object being unmounted
mountObj the object we are unmounted from
node the mountObj node we are unmounted from
See also:
onAdd for an example

Member Data Documentation

The group that this datablock will show up in under the "Scripted" tab in the World Editor Library.



Copyright © GarageGames, LLC. All Rights Reserved.