CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
357 stars 84 forks source link

More obvious documentation for users #273

Open j9liu opened 1 year ago

j9liu commented 1 year ago

We're getting a lot of questions on the forum about how to do simple things that should be apparent from our public API. We already have XML documentation for all public files and functions, but these comments don't translate to the assembly file, so people don't see it when they use it in their own code. For example, if you write CesiumWgs84Ellipsoid.GetRadii() in your code, there are no comments when you hover over it:

image

There are also no comments when you ctrl-click it:

(This is taken from the forum.)

Is there a way we can make documentation more obvious? Or since we use doxygen for Cesium for Unreal, maybe we can use it here too? Haven't looked into it, but according to this forum thread it works for C#.

kring commented 1 year ago

The first step is probably to set the C# compiler option that tells it to generate an XML file with the doc comments at compile time, and put it alongside the built .DLL. Visual Studio should then see that XML file and use it to display Intellisense to the user, as well as (I think) showing doc comments when the user does a "Go to Definition".

In a normal MSBuild project, it's easy to enable this option: https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#generatedocumentationfile

It will be different in Unity, but worst case scenario we should be able to add the appropriate command-line option to the csc.rsp files.

csciguy8 commented 1 year ago

Just wrote up a related issue, #317

Users click on the ? button, goes to a missing page.

AoutoCooper commented 1 year ago

Hi, I knew it's been two weeks, but I'm a user for the last 3 months (ever since this project came out for unity really) and I didn't even know there was documentation... Where can I find it? I've been pretty much winging it so far, so a doc other than the quick start would actually be great.

kring commented 1 year ago

All of the documentation we currently have can be found here: https://cesium.com/learn/unity/

We'll be adding more over time. The best source for learning how to use Cesium for Unity programmatically from C# is to look at the source in this repo, which has extensive documentation on all the classes and methods.