I have a custom editor script wich permit me to add some behavior to a unity components: enter image description here

Here you see the extra extensions with the "test" label.

I would like to add in that audio source editor, the inspector preview of the AudioClip, like the one we see when we are selecting any clip in unity:

enter image description here

And in bonus, I would like when i preview the sound, to apply the settings of the audio source (volume, pitch...).

I Will certainly use Reflection to achieve that. In the source code, I'm looking inside the script AudioClipInspector and the function DoRenderPreview... If someone can give me some help to implement that inside a OnGUI or OnInspectorGUI() of my editor script, it would be great !


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.