@Override public void dispose() { if (currentTest != null) currentTest.dispose(); stage.dispose(); skin.dispose(); }
void changeTest(int behaviorIndex) { // Remove the old behavior and its window testsTable.clear(); if (currentTest != null) { if (currentTest.getDetailWindow() != null) currentTest.getDetailWindow().remove(); currentTest.dispose(); } // Add the new behavior and its window currentTest = tests[behaviorIndex]; Gdx.app.log("BehaviorTreeTests", "***********************************************"); Gdx.app.log("BehaviorTreeTests", "Starting test " + currentTest.getClass().getSimpleName()); Gdx.app.log("BehaviorTreeTests", "***********************************************"); String description = currentTest.getDescription(); if (description != null) { Gdx.app.log("BehaviorTreeTests", description); Gdx.app.log("BehaviorTreeTests", "***********************************************"); } currentTest.create(testsTable); InputMultiplexer im = (InputMultiplexer) Gdx.input.getInputProcessor(); if (im.size() > 1) im.removeProcessor(1); if (currentTest.getInputProcessor() != null) im.addProcessor(currentTest.getInputProcessor()); if (currentTest.getDetailWindow() != null) stage.addActor(currentTest.getDetailWindow()); }