Eonirr

Untitled

Nov 28th, 2025
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. [CustomEditor(typeof(AudioManager))]
  2. public class AudioManagerEditor : Editor
  3. {
  4. float volume = 1f;
  5.  
  6. public override void OnInspectorGUI()
  7. {
  8. DrawDefaultInspector();
  9.  
  10. volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f);
  11.  
  12. if (GUILayout.Button("Play Sound"))
  13. {
  14. AudioManagert = (AudioManager)target;
  15. if(t.clip != null)
  16. AudioSource.PlayClip(t.clip, volume);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment