------------------------------------------------------------------ SchedulerCallbackTest ------------------------------------------------------------------
| 412 | // |
| 413 | //------------------------------------------------------------------ |
| 414 | SchedulerCallbackTest::SchedulerCallbackTest() |
| 415 | { |
| 416 | auto node = Node::create(); |
| 417 | addChild(node, 0); |
| 418 | node->setName("a node"); |
| 419 | |
| 420 | _total = 0; |
| 421 | node->schedule( |
| 422 | [&](float dt) { |
| 423 | _total += dt; |
| 424 | AXLOGD("hello world: {} - total: {}", dt, _total); |
| 425 | }, |
| 426 | 0.5, "some_key"); |
| 427 | |
| 428 | node->scheduleOnce( |
| 429 | [&](float dt) { |
| 430 | // the local variable "node" will go out of scope, so I have to get it from "this" |
| 431 | auto anode = this->getChildByName("a node"); |
| 432 | anode->unschedule("some_key"); |
| 433 | }, |
| 434 | 5, "ignore_key"); |
| 435 | } |
| 436 | |
| 437 | void SchedulerCallbackTest::onEnter() |
| 438 | { |
nothing calls this directly
no test coverage detected