public void changeCameraOrtho(float zoomDirection) { print("zoom dir = " + zoomDirection); if (zoomDirection > 0) { if (orthoSize == OrthoSizes.CLOSE) { orthoSize = OrthoSizes.MEDIUM; cam.orthographicSize = GetOrthoSize(OrthoSizes.MEDIUM); } else if (orthoSize == OrthoSizes.MEDIUM) { orthoSize = OrthoSizes.LONG; cam.orthographicSize = GetOrthoSize(OrthoSizes.LONG); } } else { if (orthoSize == OrthoSizes.LONG) { orthoSize = OrthoSizes.MEDIUM; cam.orthographicSize = GetOrthoSize(OrthoSizes.MEDIUM); } else if (orthoSize == OrthoSizes.MEDIUM) { orthoSize = OrthoSizes.CLOSE; cam.orthographicSize = GetOrthoSize(OrthoSizes.CLOSE); } } }
public float GetOrthoSize(OrthoSizes size) { switch (size) { case OrthoSizes.CLOSE: return(4.21875f); case OrthoSizes.MEDIUM: return(8.4375f); case OrthoSizes.LONG: return(16.875f); } return(0); }