File tree Expand file tree Collapse file tree 5 files changed +1109
-140
lines changed Expand file tree Collapse file tree 5 files changed +1109
-140
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,19 @@ public override void OnInspectorGUI() {
32
32
fbxPrefab . SetSourceModel ( newFbxAsset ) ;
33
33
}
34
34
35
+ EditorGUI . EndDisabledGroup ( ) ;
36
+
35
37
#if FBXEXPORTER_DEBUG
36
38
GUILayout . BeginHorizontal ( ) ;
37
39
GUILayout . Label ( "Debug info:" ) ;
38
- EditorGUILayout . SelectableLabel ( fbxPrefab . GetFbxHistory ( ) . ToJson ( ) ) ;
40
+ try {
41
+ fbxPrefab . GetFbxHistory ( ) . ToJson ( ) ;
42
+ } catch ( System . Exception xcp ) {
43
+ Debug . LogException ( xcp ) ;
44
+ }
45
+ EditorGUILayout . SelectableLabel ( fbxPrefab . GetFbxHistoryString ( ) ) ;
39
46
GUILayout . EndHorizontal ( ) ;
40
47
#endif
41
-
42
- EditorGUI . EndDisabledGroup ( ) ;
43
48
}
44
49
}
45
50
}
Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ namespace FbxExporters.UnitTests
16
16
{
17
17
public abstract class ExporterTestBase
18
18
{
19
+ /// <summary>
20
+ /// Sleep an amount of time (in ms) so we can safely assume that the timestamp on an fbx will change.
21
+ /// </summary>
22
+ public void SleepForFileTimestamp ( ) {
23
+ System . Threading . Thread . Sleep ( 1000 ) ;
24
+ }
25
+
19
26
private string _testDirectory ;
20
27
protected string filePath {
21
28
get {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public void ReplaceTest ()
74
74
// Export it to the same fbx path. But first, wait one second so
75
75
// that its timestamp differs enough for Unity to notice it
76
76
// changed.
77
- System . Threading . Thread . Sleep ( 1000 ) ;
77
+ SleepForFileTimestamp ( ) ;
78
78
FbxExporters . Editor . ModelExporter . ExportObject ( m_fbxPath , newHierarchy ) ;
79
79
AssetDatabase . Refresh ( ) ;
80
80
@@ -103,7 +103,7 @@ public void ExpensivePerformanceTest ()
103
103
var stopwatch = new System . Diagnostics . Stopwatch ( ) ;
104
104
stopwatch . Start ( ) ;
105
105
106
- // Create 1000 fbx models and 1000 prefabs.
106
+ // Create N fbx models and N/2 prefabs.
107
107
// Each prefab points to an fbx model.
108
108
//
109
109
// Then modify one fbx model. Shouldn't take longer than 1s.
You can’t perform that action at this time.
0 commit comments