File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,16 @@ public class FbxPrefabInspector : UnityEditor.Editor {
8
8
public override void OnInspectorGUI ( ) {
9
9
FbxPrefab fbxPrefab = ( FbxPrefab ) target ;
10
10
11
+ // We can only change these settings when applied to a prefab.
12
+ bool isDisabled = AssetDatabase . GetAssetPath ( fbxPrefab ) == "" ;
13
+ if ( isDisabled ) {
14
+ EditorGUILayout . HelpBox ( "Please select a prefab. You can't edit an instance in the scene." ,
15
+ MessageType . Info ) ;
16
+ }
17
+ EditorGUI . BeginDisabledGroup ( isDisabled ) ;
18
+
11
19
fbxPrefab . SetAutoUpdate ( EditorGUILayout . Toggle ( "Auto-update:" , fbxPrefab . WantsAutoUpdate ( ) ) ) ;
12
- if ( ! fbxPrefab . WantsAutoUpdate ( ) ) {
20
+ if ( ! isDisabled && ! fbxPrefab . WantsAutoUpdate ( ) ) {
13
21
if ( GUILayout . Button ( "Sync prefab to FBX" ) ) {
14
22
fbxPrefab . SyncPrefab ( ) ;
15
23
}
@@ -30,6 +38,8 @@ public override void OnInspectorGUI() {
30
38
EditorGUILayout . SelectableLabel ( fbxPrefab . GetFbxHistory ( ) . ToJson ( ) ) ;
31
39
GUILayout . EndHorizontal ( ) ;
32
40
#endif
41
+
42
+ EditorGUI . EndDisabledGroup ( ) ;
33
43
}
34
44
}
35
45
}
You can’t perform that action at this time.
0 commit comments