Skip to content

Commit

Permalink
Add option to make camera orthographic
Browse files Browse the repository at this point in the history
  • Loading branch information
kinsi55 committed Apr 14, 2021
1 parent f2fe233 commit ef8c312
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Configuration/CameraSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ public float previewScreenSize {
public bool ShouldSerializepreviewScreenSize() => type == CameraType.Positionable;

private float _FOV;
public float FOV { get => overrideToken?.FOV ?? _FOV; set { _FOV = cam.UCamera.fieldOfView = value; } }
public float FOV {
get => overrideToken?.FOV ?? _FOV;
set { _FOV = cam.UCamera.fieldOfView = value; cam.UCamera.orthographicSize = _FOV / 30f; }
}

public int layer {
get => (int)cam.UCamera.depth;
Expand Down Expand Up @@ -269,6 +272,11 @@ public float renderScale {
}
}

public bool orthographic {
get => cam.UCamera.orthographic;
set => cam.UCamera.orthographic = value;
}

[JsonProperty("visibleObjects")]
private GameObjects _visibleObjects;
[JsonIgnore]
Expand Down

0 comments on commit ef8c312

Please sign in to comment.