use of com.talosvfx.talos.editor.addons.scene.logic.components.RendererComponent in project talos by rockbite.
the class SceneEditorWorkspace method onLayerListUpdated.
@EventHandler
public void onLayerListUpdated(LayerListUpdated event) {
Array<String> layerList = getLayerList();
// find all game objects and if any of them is on layer that does not exist, change its layer to default
Array<GameObject> list = new Array<>();
list = currentContainer.getSelfObject().getChildrenByComponent(RendererComponent.class, list);
for (GameObject gameObject : list) {
RendererComponent component = gameObject.getComponentSlow(RendererComponent.class);
String sortingLayer = component.getSortingLayer();
if (!layerList.contains(sortingLayer, false)) {
component.setSortingLayer("Default");
}
}
}
Aggregations