File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
UnityToJSON/Assets/Editor/UnityJSONExporter Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,13 @@ public class JECamera : JEComponent
19
19
20
20
public override JSONComponent ToJSON ( )
21
21
{
22
+ var cam = unityComponent as Camera ;
22
23
var json = new JSONCamera ( ) ;
23
24
json . type = "Camera" ;
25
+ json . projection = cam . orthographic ? ProjectionType . Orthogonal : ProjectionType . Perspective ;
26
+ json . fovVertical = cam . fieldOfView ;
27
+ json . near = cam . nearClipPlane ;
28
+ json . far = cam . farClipPlane ;
24
29
return json ;
25
30
}
26
31
Original file line number Diff line number Diff line change @@ -108,9 +108,18 @@ public class JSONTimeOfDay : JSONComponent
108
108
public float timeOff ;
109
109
}
110
110
111
- public class JSONCamera : JSONComponent
112
- {
111
+ public enum ProjectionType
112
+ {
113
+ Perspective ,
114
+ Orthogonal
115
+ }
113
116
117
+ public class JSONCamera : JSONComponent
118
+ {
119
+ public ProjectionType projection ;
120
+ public float fovVertical ;
121
+ public float near ;
122
+ public float far ;
114
123
}
115
124
116
125
public class JSONLight : JSONComponent
You can’t perform that action at this time.
0 commit comments