File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ namespace FbxExporters.EditorTools {
6
6
[ CustomEditor ( typeof ( FbxPrefab ) ) ]
7
7
public class FbxPrefabInspector : UnityEditor . Editor {
8
8
public override void OnInspectorGUI ( ) {
9
+
10
+ SerializedProperty m_GameObjectProp = serializedObject . FindProperty ( "m_nameMapping" ) ;
11
+
9
12
FbxPrefab fbxPrefab = ( FbxPrefab ) target ;
10
13
11
14
// We can only change these settings when applied to a prefab.
@@ -28,17 +31,18 @@ public override void OnInspectorGUI() {
28
31
29
32
EditorGUI . EndDisabledGroup ( ) ;
30
33
34
+ EditorGUILayout . PropertyField ( m_GameObjectProp , true ) ;
35
+
31
36
#if FBXEXPORTER_DEBUG
32
- GUILayout . BeginHorizontal ( ) ;
33
- GUILayout . Label ( "Debug info:" ) ;
37
+ EditorGUILayout . LabelField ( "Debug info:" ) ;
34
38
try {
35
- fbxPrefab . GetFbxHistory ( ) . ToJson ( ) ;
39
+ fbxPrefabUtility . GetFbxHistory ( ) . ToJson ( ) ;
36
40
} catch ( System . Exception xcp ) {
37
41
Debug . LogException ( xcp ) ;
38
42
}
39
- EditorGUILayout . SelectableLabel ( fbxPrefab . GetFbxHistoryString ( ) ) ;
40
- GUILayout . EndHorizontal ( ) ;
43
+ EditorGUILayout . SelectableLabel ( fbxPrefabUtility . GetFbxHistoryString ( ) ) ;
41
44
#endif
45
+ serializedObject . ApplyModifiedProperties ( ) ;
42
46
}
43
47
}
44
- }
48
+ }
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ public class FbxPrefab : MonoBehaviour
24
24
[ SerializeField ] // [HideInInspector]
25
25
string m_fbxHistory ;
26
26
27
+ [ System . Serializable ]
28
+ public struct StringPair { public string FBXObjectName ; public string UnityObjectName ; }
29
+
30
+ [ SerializeField ]
31
+ StringPair [ ] m_nameMapping ;
32
+
27
33
/// <summary>
28
34
/// Which FBX file does this refer to?
29
35
/// </summary>
@@ -47,6 +53,14 @@ public string FbxHistory {
47
53
}
48
54
}
49
55
56
+ public StringPair [ ] NameMapping
57
+ {
58
+ get
59
+ {
60
+ return m_nameMapping ;
61
+ }
62
+ }
63
+
50
64
public GameObject FbxModel {
51
65
get {
52
66
return m_fbxModel ;
You can’t perform that action at this time.
0 commit comments