----------------------------------------------------------------------------- VScriptEvet::onTrigger( pTime, pDelta ); Execute a method or evaluate a command. -----------------------------------------------------------------------------
| 69 | // |
| 70 | //----------------------------------------------------------------------------- |
| 71 | void 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 | } |