public override void OnInspectorGUI() { base.OnInspectorGUI(); SettingComponent t = (SettingComponent)target; EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); { m_SettingHelperInfo.Draw(); } EditorGUI.EndDisabledGroup(); if (EditorApplication.isPlaying) { if (GUILayout.Button("Save Settings")) { t.Save(); } if (GUILayout.Button("Remove All Settings")) { t.RemoveAllKeys(); } } serializedObject.ApplyModifiedProperties(); Repaint(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); SettingComponent t = target as SettingComponent; EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); { m_SettingHelperInfo.Draw(); } EditorGUI.EndDisabledGroup(); if (EditorApplication.isPlaying) { if (GUILayout.Button("Save Settings")) { t.Save(); } if (GUILayout.Button("Remove All Settings")) { t.RemoveAllKeys(); } } }