如何检查 Actor 是否被移除或不在舞台上?
像这样:
if(actor.isRemoved) {
// enter code here
}
最佳答案
来自Documentation :
getStage
public Stage getStage() Returns the stage that this actor is currently in, or null if not in a stage.
所以你可以像这样使用它:
if(actor.getStage() == null) {
//actor not on stage
}
关于java - libGDX : How check if the actor exist on stage or not,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33270598/