概要
using System.Linq; using UnityEditor; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var path = "ProjectSettings/AudioManager.asset"; var manager = AssetDatabase.LoadAllAssetsAtPath( path ).FirstOrDefault(); var obj = new SerializedObject( manager ); var prop = obj.FindProperty( "m_DisableAudio" ); prop.boolValue = !prop.boolValue; obj.ApplyModifiedProperties(); } }