嘿,我是Libgdx的初學者。我對處理這些東西有點困惑。Libgdx - 反覆處理?
Texture brickTexture;
Array<Brick> bricks;
public Game {
brickTexture = new Texture("brick.png");
bricks = new Array<Brick>();
for (int i = 0; i < 10; i++) {
Brick brick = new Brick(i, brickTexture);
bricks.add(brick);
}
}
void dispose() {
brickTexture.dispose(); // brick texture loaded in this class
for (Brick brick : bricks) brick.brickTexture.dispose(); // disposing the public texture which was earlier passed on to the brick class
}
這兩行應該在dispose方法還是隻有第一個?
thanx使用了我已經告訴過的相同方法,但我懷疑可能需要處理所有對象。 –