Hi,
I try to turn on and off a object particles which I loaded by Unigine::World::get()->loadNode, but nothing happens.
The code below will be visited in debug. But particles are still spawning.
Unigine::Vector<Unigine::NodePtr> hierarchy;
myloadednode->getHierarchy(hierarchy);
for (auto & node : hierarchy) {
if (node->getType() == Unigine::Node::OBJECT_PARTICLES) {
Unigine::ObjectParticlesPtr particle = Unigine::ObjectParticles::cast(node);
particle->setNumberPerSpawn(0);
particle->setEmitterEnabled(0);
}
}
Did I forget something?
Thanks,
Sebastian