| 2789 | } |
| 2790 | |
| 2791 | void AddAndDeleteParticleSystems::removeSystem(float dt) |
| 2792 | { |
| 2793 | ssize_t nChildrenCount = _batchNode->getChildren().size(); |
| 2794 | if (nChildrenCount > 0) |
| 2795 | { |
| 2796 | AXLOGD("remove random system"); |
| 2797 | unsigned int uRand = rand() % (nChildrenCount - 1); |
| 2798 | _batchNode->removeChild(_batchNode->getChildren().at(uRand), true); |
| 2799 | |
| 2800 | auto particleSystem = ParticleSystemQuad::create("Particles/Spiral.plist"); |
| 2801 | // add new |
| 2802 | |
| 2803 | particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED); |
| 2804 | particleSystem->setTotalParticles(200); |
| 2805 | |
| 2806 | particleSystem->setPosition(Vec2(rand() % 300, rand() % 400)); |
| 2807 | |
| 2808 | AXLOGD("add a new system"); |
| 2809 | unsigned int randZ = rand() % 100; |
| 2810 | _batchNode->addChild(particleSystem, randZ, -1); |
| 2811 | } |
| 2812 | } |
| 2813 | |
| 2814 | void AddAndDeleteParticleSystems::update(float dt) |
| 2815 | { |
nothing calls this directly
no test coverage detected