- Home /
Question by
Kody · Apr 26, 2014 at 07:05 PM ·
guieditoreditor-scriptingpreview
Custom Inspector Preview Buttons
I've created a custom inspector for one of my ScriptableObjects. I use the void OnPreviewGUI(Rect r, GUIStyle background)
function to draw the preview window. Some of the built in types have buttons on the titlebar of their preview windows. For example audio clips have three buttons, play on selected, loop, and play:
Is there any way for me to implement my own buttons in the titlebar of a custom inspector's preview window just like the audio clips do?
title.png
(18.5 kB)
Comment
Were you able to find a solution for this? @Kody
Currently I'm using editor.DrawPreview(). I'm able to click and play it indefinitely, but I can't stop it because there are no buttons in the preview to control it.