| 276 | } |
| 277 | |
| 278 | void ManagedEditor::Update() |
| 279 | { |
| 280 | // Skip if managed object is missing |
| 281 | const auto instance = GetManagedInstance(); |
| 282 | if (instance == nullptr) |
| 283 | return; |
| 284 | |
| 285 | // Cache update method pointer |
| 286 | if (UpdateMethod == nullptr) |
| 287 | { |
| 288 | UpdateMethod = GetClass()->GetMethod("Update"); |
| 289 | if (UpdateMethod == nullptr) |
| 290 | { |
| 291 | LOG(Fatal, "Invalid Editor assembly!"); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | // Call update |
| 296 | MObject* exception = nullptr; |
| 297 | UpdateMethod->Invoke(instance, nullptr, &exception); |
| 298 | if (exception) |
| 299 | { |
| 300 | MException ex(exception); |
| 301 | ex.Log(LogType::Warning, TEXT("ManagedEditor::Update")); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | void ManagedEditor::Exit() |
| 306 | { |
no test coverage detected