Don't activate/deactivate/remove entities when not needed
This commit is contained in:
parent
b389cb9c2b
commit
cc53757a37
@ -39,19 +39,25 @@ public final class Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void activate() {
|
public void activate() {
|
||||||
active = true;
|
if (!active) {
|
||||||
refresh();
|
active = true;
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
active = false;
|
if (active) {
|
||||||
refresh();
|
active = false;
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
removed = true;
|
if (!removed) {
|
||||||
active = false;
|
removed = true;
|
||||||
refresh();
|
active = false;
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Engine getEngine() {
|
public Engine getEngine() {
|
||||||
|
Loading…
Reference in New Issue
Block a user