feat: migrate setting centralize to haptic system.
This commit is contained in:
@@ -13,10 +13,10 @@ namespace OCES.Audio.Editor
|
||||
return new SettingsProvider("Project/Audio Extend", SettingsScope.Project)
|
||||
{
|
||||
label = "Audio Extend",
|
||||
guiHandler = searchContext =>
|
||||
guiHandler = _ =>
|
||||
{
|
||||
var settings = AssetDatabase.LoadAssetAtPath<AudioExtendSettings>(k_assetPath);
|
||||
if (settings == null)
|
||||
AudioExtendSettings settings = AssetDatabase.LoadAssetAtPath<AudioExtendSettings>(k_assetPath);
|
||||
if (!settings)
|
||||
{
|
||||
EditorGUILayout.HelpBox(
|
||||
$"未找到 AudioExtendSettings.asset\n期望路径: {k_assetPath}",
|
||||
@@ -26,21 +26,24 @@ namespace OCES.Audio.Editor
|
||||
return;
|
||||
}
|
||||
|
||||
SerializedObject so = new SerializedObject(settings);
|
||||
SerializedProperty prop = so.GetIterator();
|
||||
prop.NextVisible(true); // 跳过 Script 字段
|
||||
SerializedObject serializedObject = new(settings);
|
||||
SerializedProperty serializedProperty = serializedObject.GetIterator();
|
||||
serializedProperty.NextVisible(true); // 跳过 Script 字段
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
while (prop.NextVisible(false))
|
||||
EditorGUILayout.PropertyField(prop, true);
|
||||
while (serializedProperty.NextVisible(false))
|
||||
{
|
||||
EditorGUILayout.PropertyField(serializedProperty, true);
|
||||
}
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
so.ApplyModifiedProperties();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
EditorUtility.SetDirty(settings);
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
},
|
||||
keywords = new[] { "Audio", "SFX", "Music", "Mixer", "Path", "Import" }
|
||||
keywords = new[] { "Audio", "SFX", "Music", "Mixer", "Path", "Import" },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user