Jump to content

Finding all existing components


photo

Recommended Posts

Hello ,

Is there a better way to find all the existing components of a given type in the world?

Unigine::Vector<Unigine::NodePtr> nodes;
Unigine::World::getRootNodes(nodes);

for (int i = 0; i < nodes.size(); i++)
{
	if (auto componentPtr = Unigine::ComponentSystem::get()->getComponentInChildren<AirportComponent>(nodes.get(i)))
	{
       .....
    }
	

Thank you.

Link to comment
×
×
  • Create New...