Created
December 2, 2014 18:57
-
-
Save mendesbarreto/a0800457defcce06bd53 to your computer and use it in GitHub Desktop.
This helps calculate the orthographic camera size in the Unity3D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CameraSizeHandler : MonoBehaviour { | |
| //public Camera cam; | |
| // Use this for initialization | |
| void Start () | |
| { | |
| Resolution res = Screen.currentResolution; | |
| Camera cam = this.gameObject.GetComponent<Camera>(); | |
| cam.orthographicSize = (res.height * 0.5f) * 0.01f; | |
| } | |
| // Update is called once per frame | |
| void Update () { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment