public override void OnInspectorGUI() { serializedObject.Update(); if (!serializedObject.isEditingMultipleObjects) { VJGamepadDataSource src = target as VJGamepadDataSource; if (src.sourceName == null || src.sourceName.Length == 0) { src.sourceName = VJGamePadButtonUtility.GetButtonNameOf(src.button); EditorUtility.SetDirty(src); } } else { foreach (UnityEngine.Object o in targets) { VJGamepadDataSource src = o as VJGamepadDataSource; if (src.sourceName == null || src.sourceName.Length == 0) { src.sourceName = VJGamePadButtonUtility.GetButtonNameOf(src.button); EditorUtility.SetDirty(src); } } } base.OnInspectorGUI(); if (GUI.changed) { sourceNameProperty.stringValue = VJGamePadButtonUtility.GetButtonNameOf((VJGamepadButton)buttonProperty.enumValueIndex); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { VJGamepadDataSource src = target as VJGamepadDataSource; if (src.sourceName == null || src.sourceName.Length == 0) { src.sourceName = VJGamePadButtonUtility.GetButtonNameOf(src.button); EditorUtility.SetDirty(target); } base.OnInspectorGUI(); if (GUI.changed) { src.sourceName = VJGamePadButtonUtility.GetButtonNameOf(src.button); EditorUtility.SetDirty(target); } }