Skip to content

Commit bc6df6e

Browse files
authored
Merge pull request #359 from Unity-Technologies/Uni-42179-FixingFBXextensionBug
Uni-42179-FixingFBXextensionBug- Added more files extensions for FBX and PREFAB
2 parents 0e3fa66 + eafca1c commit bc6df6e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Assets/FbxExporters/Editor/FbxPrefabAutoUpdater.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public static string FindFbxPrefabAssetPath()
5151
}
5252

5353
public static bool IsFbxAsset(string assetPath) {
54-
return assetPath.EndsWith(".fbx");
54+
return assetPath.ToLower().EndsWith(".fbx");
5555
}
5656

5757
public static bool IsPrefabAsset(string assetPath) {
58-
return assetPath.EndsWith(".prefab");
58+
return assetPath.ToLower().EndsWith(".prefab");
5959
}
6060

6161
/// <summary>
@@ -1447,7 +1447,7 @@ public void SyncPrefab()
14471447
/// </summary>
14481448
public void SetSourceModel(GameObject fbxModel) {
14491449
// Null is OK. But otherwise, fbxModel must be an fbx.
1450-
if (fbxModel && !UnityEditor.AssetDatabase.GetAssetPath(fbxModel).EndsWith(".fbx")) {
1450+
if (fbxModel && !IsFbxAsset(UnityEditor.AssetDatabase.GetAssetPath(fbxModel))) {
14511451
throw new System.ArgumentException("FbxPrefab source model must be an fbx asset");
14521452
}
14531453

Assets/FbxExporters/Editor/FbxPrefabInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override void OnInspectorGUI() {
2323
var oldFbxAsset = fbxPrefabUtility.GetFbxAsset();
2424
var newFbxAsset = EditorGUILayout.ObjectField(new GUIContent("Source Fbx Asset", "The FBX file that is linked to this Prefab"), oldFbxAsset,
2525
typeof(GameObject), allowSceneObjects: false) as GameObject;
26-
if (newFbxAsset && !AssetDatabase.GetAssetPath(newFbxAsset).EndsWith(".fbx")) {
26+
if (newFbxAsset && !FbxPrefabAutoUpdater.IsFbxAsset(UnityEditor.AssetDatabase.GetAssetPath(newFbxAsset))) {
2727
Debug.LogError("FbxPrefab must point to an Fbx asset (or none).");
2828
} else if (newFbxAsset != oldFbxAsset) {
2929
fbxPrefabUtility.SetSourceModel(newFbxAsset);

0 commit comments

Comments
 (0)