void OnGUI() { EditorGUILayout.LabelField("There is no SoundManager Prefab in your Assets/AudioClips folder, do you want us to create one ?", EditorStyles.wordWrappedLabel); GUILayout.Space(50); if (GUILayout.Button("Agree!")) { GameObject SoundManager = new GameObject(); SoundManager.name = "SoundManager"; SoundManager.AddComponent <Harmony>(); SoundManager.AddComponent <SoundManager>(); PrefabUtility.CreatePrefab("Assets/AudioClips/SoundManager.prefab", SoundManager); DestroyImmediate(SoundManager); HarmonyEditor.HarmonyProcess(); this.Close(); } if (GUILayout.Button("No")) { this.Close(); } }
void OnGUI() { EditorGUILayout.LabelField("There is no AudioClips folder in your project, do you want us to create one ?", EditorStyles.wordWrappedLabel); GUILayout.Space(50); if (GUILayout.Button("Agree!")) { AssetDatabase.CreateFolder("Assets", "AudioClips"); HarmonyEditor.HarmonyProcess(); this.Close(); } if (GUILayout.Button("No")) { this.Close(); } }