void EditorScene::SetForceLodLayerRecursive(Entity *node, int32 layer) { LodComponent *lc = GetLodComponent(node); if(lc) { lc->SetForceLodLayer(layer); } int32 count = node->GetChildrenCount(); for(int32 i = 0; i < count; ++i) { SetForceLodLayerRecursive(node->GetChild(i), layer); } }
void EditorScene::SetForceLodLayer(Entity *node, int32 layer) { if(!node) return; Entity *n = node; do { LodComponent *lc = GetLodComponent(n); if(lc) { lc->SetForceLodLayer(layer); } n = n->GetParent(); } while (n); SetForceLodLayerRecursive(node, layer); }