@@ -39,7 +39,10 @@ public bool Equals(CamSettings other)
39
39
bool equalAspect = other . aspect == aspect ;
40
40
bool equalFoV = Math . Abs ( other . fieldOfView - fieldOfView ) <= float . Epsilon ;
41
41
bool equalZoom = Math . Abs ( other . zoomLevel - zoomLevel ) <= float . Epsilon ;
42
- bool isEqual = equalScreen && equalAspect && equalFoV && equalZoom ;
42
+ bool equalOrtho = other . isOrtho == isOrtho ;
43
+ bool isEqual = equalScreen && equalAspect &&
44
+ equalFoV && equalZoom &&
45
+ equalOrtho ;
43
46
//if (!isEqual)
44
47
//{
45
48
// Debug.LogFormat("scr {0}, asp {1}, fov {2}, zoom {3}", equalScreen, equalAspect, equalFoV, equalZoom);
@@ -227,7 +230,7 @@ protected Vector2 GetScreenRenderSize()
227
230
return screenRenderSize ;
228
231
}
229
232
230
- protected void SetupCamera ( )
233
+ private void SetupCamera ( )
231
234
{
232
235
var aspect = AspectStretch ;
233
236
@@ -307,8 +310,8 @@ protected int[] GetRenderTextureSize(Vector2 size, Vector2 aspect)
307
310
height += 1 ;
308
311
309
312
// Just in case
310
- width = Mathf . Max ( 2 , width ) ;
311
- height = Mathf . Max ( 2 , height ) ;
313
+ width = Mathf . Clamp ( width , 2 , 4096 ) ;
314
+ height = Mathf . Clamp ( height , 2 , 4096 ) ;
312
315
313
316
return new [ ] { width , height } ;
314
317
}
@@ -356,12 +359,13 @@ public void ForceRefresh()
356
359
lastSettings . screenSize = new [ ] { 0 , 0 } ;
357
360
}
358
361
359
- public void CheckCamera ( )
362
+ public bool CheckCamera ( )
360
363
{
361
364
var currentSettings = new CamSettings ( AspectStretch , zoomLevel , cam . fieldOfView , cam . orthographic ) ;
362
365
bool didChange = currentSettings . Equals ( lastSettings ) == false ;
363
366
if ( didChange )
364
367
SetupCamera ( ) ;
368
+ return didChange ;
365
369
}
366
370
}
367
371
}
0 commit comments