MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onTrigger

Method onTrigger

Engine/source/Verve/Extension/Script/VScriptEvent.cpp:71–102  ·  view source on GitHub ↗

----------------------------------------------------------------------------- VScriptEvet::onTrigger( pTime, pDelta ); Execute a method or evaluate a command. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

69//
70//-----------------------------------------------------------------------------
71void VScriptEvent::onTrigger( const S32 &pTime, const S32 &pDelta )
72{
73 Parent::onTrigger( pTime, pDelta );
74
75 switch ( mCommandType )
76 {
77 case k_TypeExpression :
78 {
79
80 // Evaluate Expression.
81 Con::evaluate( mCommand, false, NULL );
82
83 } break;
84
85 case k_TypeMethod :
86 {
87
88 SimObject *object = getSceneObject();
89 if ( object )
90 {
91 // Execute Method.
92 Con::executef( object, mCommand.c_str() );
93 }
94 else
95 {
96 // Execute Function.
97 Con::executef( mCommand.c_str());
98 }
99
100 } break;
101 }
102}

Callers

nothing calls this directly

Calls 3

evaluateFunction · 0.85
executefFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected