Skip to content

Commit 62cb7c7

Browse files
author
Benoit Hudson
committed
nojira: fixes to handle 2018.2.0b3
This gets the code to compile and some unit tests to pass that were failing due to an extra log.
1 parent b0cd8a5 commit 62cb7c7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Packages/com.unity.formats.fbx/Editor/Scripts/FbxExporterRepairMissingScripts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static string GetSourceCodeSearchID()
4646
var fbxPrefabObj = AssetDatabase.LoadMainAssetAtPath(FbxExporters.FbxPrefabAutoUpdater.FindFbxPrefabAssetPath());
4747
string searchID = null;
4848
string guid;
49-
#if UNITY_2018_2_OR_LATER
49+
#if UNITY_2018_2_OR_NEWER
5050
long fileId;
5151
#else
5252
int fileId;

Packages/com.unity.formats.fbx/Editor/Scripts/FbxPrefabAutoUpdater.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace FbxExporters
2626
{
2727
#if COM_UNITY_FORMATS_FBX_AS_ASSET
2828
public const string FBX_PREFAB_FILE = "/UnityFbxPrefab.dll";
29-
#elif UNITY_2018_2_OR_LATER
29+
#elif UNITY_2018_2_OR_NEWER
3030
public const string FBX_PREFAB_FILE = "/FbxPrefab.cs";
3131
#else // Unity 2018.1 and fbx installed as a package
3232
public const string FBX_PREFAB_FILE = "Packages/com.unity.formats.fbx/Runtime/FbxPrefab.cs";
@@ -39,15 +39,15 @@ namespace FbxExporters
3939

4040
public static string FindFbxPrefabAssetPath()
4141
{
42-
#if COM_UNITY_FORMATS_FBX_AS_ASSET || UNITY_2018_2_OR_LATER
42+
#if COM_UNITY_FORMATS_FBX_AS_ASSET || UNITY_2018_2_OR_NEWER
4343
// Find guids that are scripts that look like FbxPrefab.
4444
// That catches FbxPrefabTest too, so we have to make sure.
4545
var allGuids = AssetDatabase.FindAssets("FbxPrefab t:MonoScript");
4646
string foundPath = "";
4747
foreach (var guid in allGuids) {
4848
var path = AssetDatabase.GUIDToAssetPath(guid);
4949
if (path.EndsWith(FBX_PREFAB_FILE)) {
50-
if (!string.IsNullOrEmpty(foundPath)) {
50+
if (foundPath != "") {
5151
// How did this happen? Anyway, just don't try.
5252
Debug.LogWarning(string.Format("{0} found in multiple places; did you forget to delete one of these?\n{1}\n{2}",
5353
FBX_PREFAB_FILE.Substring(1), foundPath, path));
@@ -56,8 +56,10 @@ public static string FindFbxPrefabAssetPath()
5656
foundPath = path;
5757
}
5858
}
59-
Debug.LogWarning(string.Format("{0} not found; are you trying to uninstall {1}?", FBX_PREFAB_FILE.Substring(1), FbxExporters.Editor.ModelExporter.PACKAGE_UI_NAME));
60-
return "";
59+
if (foundPath == "") {
60+
Debug.LogWarning(string.Format("{0} not found; are you trying to uninstall {1}?", FBX_PREFAB_FILE.Substring(1), FbxExporters.Editor.ModelExporter.PACKAGE_UI_NAME));
61+
}
62+
return foundPath;
6163
#else
6264
// In Unity 2018.1, FindAssets can't find FbxPrefab.cs in a package.
6365
// So we hardcode the path.

0 commit comments

Comments
 (0)