using System;
using UnityEngine;
namespace UnityEditor.Rendering
{
/// Editor window that adds a button to browse the help url, specify when defining your inherited class
public class EditorWindowWithHelpButton : EditorWindow
{
static Lazy m_IconHelpGUIContent;
GUIContent iconHelpGUIContent => m_IconHelpGUIContent.Value;
static EditorWindowWithHelpButton()
{
m_IconHelpGUIContent = new Lazy(() => new GUIContent(CoreEditorStyles.iconHelp));
}
/// Shows a button with help icon and opens the url defined by
/// The rect to show the button
protected virtual void ShowButton(Rect r)
{
if (GUI.Button(r, iconHelpGUIContent, CoreEditorStyles.iconHelpStyle))
Help.ShowHelpForObject(this);
}
}
}