| 491 | } |
| 492 | |
| 493 | void ScriptActorWrapper::OnHitWall(float timeMult) |
| 494 | { |
| 495 | if (_onHitWall == nullptr || _isDead->Get()) { |
| 496 | return; |
| 497 | } |
| 498 | |
| 499 | asIScriptEngine* engine = _obj->GetEngine(); |
| 500 | asIScriptContext* ctx = engine->RequestContext(); |
| 501 | |
| 502 | ctx->Prepare(_onHitWall); |
| 503 | ctx->SetObject(_obj); |
| 504 | ctx->SetArgFloat(0, timeMult); |
| 505 | std::int32_t r = ctx->Execute(); |
| 506 | if (r == asEXECUTION_EXCEPTION) { |
| 507 | LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.", |
| 508 | ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration()); |
| 509 | } |
| 510 | |
| 511 | engine->ReturnContext(ctx); |
| 512 | } |
| 513 | |
| 514 | void ScriptActorWrapper::OnAnimationStarted() |
| 515 | { |