Hi,
*
Question:
I’d like to know whether it’s possible to get the string value of the XML comment summary of a class.
*
What I need it for:
I’m working on a custom editor for MonoBehaviour classes.
All it’s supposed to do is create a HelpBox in the Inspector containing the MonoBehaviour’s XML comment summary text. This will hopefully make it easier for me to use and maintain my scripts.
*
Example of what I want to achieve:
I have a MonoBehaviour class named SomeClass with an XML comment:
/// <summary>
/// This class does something.
/// </summary>
public class SomeClass : MonoBehaviour
{
}
In the Inspector, I want a HelpBox to appear with the text “This class does something.”, just like in the summary:
*
What I’ve achieved so far:
[CustomEditor(typeof(MonoBehaviour), true)]
public class MonoBehaviourEditor : Editor
{
public override void OnInspectorGUI()
{
string xmlSummary = ???;
EditorGUILayout.HelpBox(xmlSummary, MessageType.None);
base.OnInspectorGUI();
}
}
As you can see by the “???” on line 6, I just need some method to get the XML summary - if there even is a method that does that.
*
Many thanks in advance!
