public static AMSettings UpdateAMSettings() { AMSettings amSettings = AddAMSettings(); amSettings.IsBeginHotUpdate = !amSettings.IsBeginHotUpdate; AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Selection.activeObject = amSettings; return(amSettings); }
public static AMSettings AddAMSettings() { AMSettings amSettings = AssetDatabase.LoadAssetAtPath <AMSettings>("Assets/Resources/AMSettings.asset"); if (amSettings == null) { amSettings = ScriptableObject.CreateInstance <AMSettings>(); AssetDatabase.CreateAsset(amSettings, "Assets/Resources/AMSettings.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } Selection.activeObject = amSettings; return(amSettings); }