- Home /
/// comments in Unity
Hi,
when I program code in C# using Visual Studio is use the /// comments to describe my classes and methods. These descriptions are visible with IntelliSense.
Is there a way to display these comments in the Unity editor?
Just found your question and i was wondering where exactly do you want to display which information from the xml documentation? The only thing that might be useful would be the class description in the inspector. This is possible but you have to write a custom inspector for your class. An alternative would be to attach an additional script which displays the documentation of another class.
Descriptions for properties and fields would be nice. $$anonymous$$aybe as a Tooltip or so...
Writing a custom editor would be awesome but i don't know if its feasible. $$anonymous$$aybe I'll look into it some day.
Answer by Vivien_Lynn · Aug 17, 2021 at 12:22 PM
Not sure if this is what you ask for, but you can show Tooltips for public variables (or private SerializeFields) in the inspector, by writing [Tooltip("Tooltip Comtent")]
in front of your variables.
Here an example: