Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include documentation in DLL to show method summary in Unity3D?

I'm working on a C# DLL plugin for Unity3D. Actually, the MonoDevelop tooltips (or Visual Studio) show only the structure of my method:

enter image description here

But it doesn't show my summary like this:

enter image description here

Even if I documented my code:

enter image description here

Is there a way to include my documentation in DLL?

SOLVED WITH THIS (thanks to krillgar)

1 : Create XML documentation file on build in VisualStudio

enter image description here

2 : Import this XML in your Assets/Plugins folder in Unity3d

like image 467
probitaille Avatar asked Oct 07 '15 14:10

probitaille


People also ask

What is DllImport __ internal )]?

Plugins link their code to C# unity using [DllImport()] . __internal is a keyword used for static linking needed by specific platforms, such as XBox and iOS. Other platforms usually use dynamic linking, hence this is not needed.

What are dll files Unity?

DLLs are another way to get code into your Unity project. I'm talking about C# code that has been compiled and packaged as a . NET assembly. The simplest way of working is to store source code directly in your Unity project. However, using DLLs gives you an alternative that has its own benefits.


1 Answers

You need to include the XML documentation file. In order to create that, you need to right-click on the Project. Under the "Build" side tab, in the "Output" section at the bottom, check the "XML documentation file" and leave the path that it creates.

When you bring your DLL over, bring that .XML file along with it, and that will put the documentation into Intellisense. I'm not sure if you'll be able to use it Unity itself, but that is how you get the summary in Visual Studio. Per probitaille's comment, you can add the XML file into the "Plugins" folder in Unity to add your comments/summaries into Unity itself.

like image 68
krillgar Avatar answered Oct 14 '22 17:10

krillgar