1
- using UnityEngine ;
1
+ //#define DEBUG_UNITTEST
2
+ using UnityEngine ;
2
3
using UnityEditor ;
3
4
using UnityEngine . TestTools ;
4
5
using NUnit . Framework ;
@@ -10,6 +11,14 @@ namespace FbxExporters.UnitTests
10
11
{
11
12
public class ModelExporterTest : ExporterTestBase
12
13
{
14
+ [ TearDown ]
15
+ public override void Term ( )
16
+ {
17
+ #if ( ! DEBUG_UNITTEST )
18
+ base . Term ( ) ;
19
+ #endif
20
+ }
21
+
13
22
[ Test ]
14
23
public void TestBasics ( )
15
24
{
@@ -322,7 +331,31 @@ public void TestExporterCallbacks()
322
331
}
323
332
324
333
[ Test ]
325
- public void TestExportCamera ( ) {
334
+ [ Ignore ( "Ignore a camera orthographic test (Uni-48092)" ) ]
335
+ public void TestExportCamera2 ( ) {
336
+ // NOTE: even though the aspect ratio is exported,
337
+ // it does not get imported back into Unity.
338
+ // Therefore don't modify or check if camera.aspect is the same
339
+ // after export.
340
+
341
+ // create a Unity camera
342
+ GameObject cameraObj = new GameObject ( "TestCamera" ) ;
343
+ Camera camera = cameraObj . AddComponent < Camera > ( ) ;
344
+
345
+ // test export orthographic camera
346
+ camera . orthographic = true ;
347
+ camera . fieldOfView = 78 ;
348
+ camera . nearClipPlane = 19 ;
349
+ camera . farClipPlane = 500.6f ;
350
+
351
+ var filename = GetRandomFbxFilePath ( ) ; // export to a different file
352
+ var fbxCamera = ExportCamera ( filename , cameraObj ) ;
353
+ CompareCameraValues ( camera , fbxCamera ) ;
354
+ Assert . AreEqual ( camera . orthographicSize , fbxCamera . orthographicSize ) ;
355
+ }
356
+
357
+ [ Test ]
358
+ public void TestExportCamera1 ( ) {
326
359
// NOTE: even though the aspect ratio is exported,
327
360
// it does not get imported back into Unity.
328
361
// Therefore don't modify or check if camera.aspect is the same
@@ -342,17 +375,6 @@ public void TestExportCamera(){
342
375
string filename = GetRandomFbxFilePath ( ) ;
343
376
var fbxCamera = ExportCamera ( filename , cameraObj ) ;
344
377
CompareCameraValues ( camera , fbxCamera ) ;
345
-
346
- // test export orthographic camera
347
- camera . orthographic = true ;
348
- camera . fieldOfView = 78 ;
349
- camera . nearClipPlane = 19 ;
350
- camera . farClipPlane = 500.6f ;
351
-
352
- filename = GetRandomFbxFilePath ( ) ; // export to a different file
353
- fbxCamera = ExportCamera ( filename , cameraObj ) ;
354
- CompareCameraValues ( camera , fbxCamera ) ;
355
- Assert . AreEqual ( camera . orthographicSize , fbxCamera . orthographicSize ) ;
356
378
}
357
379
358
380
/// <summary>
0 commit comments