I am working on side scrolling game so for that I want to define strategy for game objects.
I want to reduce draw call for game objects that are not in camera visibility either they are gone or not get turn to come in focus.
I have some working experience with AndEnginge in which I handle this situation in following manner.
public void enable() {
setVisible(true);
setIgnoreUpdate(false);
terrainBody.setActive(true);
}
public void disable() {
setVisible(false);
setIgnoreUpdate(true);
terrainBody.setActive(false);
}
I am pretty new to unity 2d game development so I want suggestion in this to improve performance of my game.
Also provide guidance for 3d objects if they come in same situation.