Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public class SetCameraProjectionMatrix : MonoBehaviour
  2. {
  3. public float fieldOfViewOverride = 60.0f;
  4.  
  5. void Start()
  6. {
  7. Camera cam = GetComponent<Camera>();
  8. Debug.AssertFormat(cam != null, "No {0} component on game object named {1} as expected.", typeof(Camera), gameObject.name);
  9. cam.projectionMatrix = Matrix4x4.Perspective(fieldOfViewOverride, cam.aspect, cam.nearClipPlane, cam.farClipPlane);
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement