| 512 | } |
| 513 | |
| 514 | void ScriptActorWrapper::OnAnimationStarted() |
| 515 | { |
| 516 | if (_onAnimationStarted == nullptr || _isDead->Get()) { |
| 517 | return; |
| 518 | } |
| 519 | |
| 520 | asIScriptEngine* engine = _obj->GetEngine(); |
| 521 | asIScriptContext* ctx = engine->RequestContext(); |
| 522 | |
| 523 | ctx->Prepare(_onAnimationStarted); |
| 524 | ctx->SetObject(_obj); |
| 525 | std::int32_t r = ctx->Execute(); |
| 526 | if (r == asEXECUTION_EXCEPTION) { |
| 527 | LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.", |
| 528 | ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration()); |
| 529 | } |
| 530 | |
| 531 | engine->ReturnContext(ctx); |
| 532 | } |
| 533 | |
| 534 | void ScriptActorWrapper::OnAnimationFinished() |
| 535 | { |