Skip to content

Commit fba9544

Browse files
authored
Merge pull request #105 from Unity-Technologies/uni-22029-prefab-redux
Uni 22029 prefab redux
2 parents 5f38b4e + bc7bd37 commit fba9544

File tree

5 files changed

+1109
-140
lines changed

5 files changed

+1109
-140
lines changed

Assets/FbxExporters/Editor/FbxPrefabInspector.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,19 @@ public override void OnInspectorGUI() {
3232
fbxPrefab.SetSourceModel(newFbxAsset);
3333
}
3434

35+
EditorGUI.EndDisabledGroup();
36+
3537
#if FBXEXPORTER_DEBUG
3638
GUILayout.BeginHorizontal();
3739
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());
3946
GUILayout.EndHorizontal();
4047
#endif
41-
42-
EditorGUI.EndDisabledGroup();
4348
}
4449
}
4550
}

Assets/FbxExporters/Editor/UnitTests/ExporterTestBase.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ namespace FbxExporters.UnitTests
1616
{
1717
public abstract class ExporterTestBase
1818
{
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+
1926
private string _testDirectory;
2027
protected string filePath {
2128
get {

Assets/FbxExporters/Editor/UnitTests/FbxPrefabAutoUpdaterTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void ReplaceTest ()
7474
// Export it to the same fbx path. But first, wait one second so
7575
// that its timestamp differs enough for Unity to notice it
7676
// changed.
77-
System.Threading.Thread.Sleep(1000);
77+
SleepForFileTimestamp();
7878
FbxExporters.Editor.ModelExporter.ExportObject(m_fbxPath, newHierarchy);
7979
AssetDatabase.Refresh();
8080

@@ -103,7 +103,7 @@ public void ExpensivePerformanceTest ()
103103
var stopwatch = new System.Diagnostics.Stopwatch ();
104104
stopwatch.Start();
105105

106-
// Create 1000 fbx models and 1000 prefabs.
106+
// Create N fbx models and N/2 prefabs.
107107
// Each prefab points to an fbx model.
108108
//
109109
// Then modify one fbx model. Shouldn't take longer than 1s.

0 commit comments

Comments
 (0)