Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CustomEditor(typeof(AudioManager))]
- public class AudioManagerEditor : Editor
- {
- float volume = 1f;
- public override void OnInspectorGUI()
- {
- DrawDefaultInspector();
- volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f);
- if (GUILayout.Button("Play Sound"))
- {
- AudioManagert = (AudioManager)target;
- if(t.clip != null)
- AudioSource.PlayClip(t.clip, volume);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment