Skip to content

Commit b89c3ac

Browse files
authored
Merge pull request #269 from Unity-Technologies/UNI-34563-BasicRemapping
Uni-34563: Added Array of pair strings in Inspector
2 parents 90e7318 + f7bf797 commit b89c3ac

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

Assets/FbxExporters/Editor/FbxPrefabInspector.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ namespace FbxExporters.EditorTools {
66
[CustomEditor(typeof(FbxPrefab))]
77
public class FbxPrefabInspector : UnityEditor.Editor {
88
public override void OnInspectorGUI() {
9+
10+
SerializedProperty m_GameObjectProp = serializedObject.FindProperty("m_nameMapping");
11+
912
FbxPrefab fbxPrefab = (FbxPrefab)target;
1013

1114
// We can only change these settings when applied to a prefab.
@@ -28,17 +31,18 @@ public override void OnInspectorGUI() {
2831

2932
EditorGUI.EndDisabledGroup();
3033

34+
EditorGUILayout.PropertyField(m_GameObjectProp, true);
35+
3136
#if FBXEXPORTER_DEBUG
32-
GUILayout.BeginHorizontal();
33-
GUILayout.Label ("Debug info:");
37+
EditorGUILayout.LabelField ("Debug info:");
3438
try {
35-
fbxPrefab.GetFbxHistory().ToJson();
39+
fbxPrefabUtility.GetFbxHistory().ToJson();
3640
} catch(System.Exception xcp) {
3741
Debug.LogException(xcp);
3842
}
39-
EditorGUILayout.SelectableLabel(fbxPrefab.GetFbxHistoryString());
40-
GUILayout.EndHorizontal();
43+
EditorGUILayout.SelectableLabel(fbxPrefabUtility.GetFbxHistoryString());
4144
#endif
45+
serializedObject.ApplyModifiedProperties();
4246
}
4347
}
44-
}
48+
}

Assets/FbxExporters/FbxPrefab.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public class FbxPrefab : MonoBehaviour
2424
[SerializeField] // [HideInInspector]
2525
string m_fbxHistory;
2626

27+
[System.Serializable]
28+
public struct StringPair { public string FBXObjectName; public string UnityObjectName; }
29+
30+
[SerializeField]
31+
StringPair[] m_nameMapping;
32+
2733
/// <summary>
2834
/// Which FBX file does this refer to?
2935
/// </summary>
@@ -47,6 +53,14 @@ public string FbxHistory {
4753
}
4854
}
4955

56+
public StringPair[] NameMapping
57+
{
58+
get
59+
{
60+
return m_nameMapping;
61+
}
62+
}
63+
5064
public GameObject FbxModel {
5165
get{
5266
return m_fbxModel;

0 commit comments

Comments
 (0)