Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion DocFxForUnity.csproj → Documentation/DocFxForUnity.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

<ItemGroup>
<Compile Include="../Assets/**/*.cs" />
</ItemGroup>

<Target Name="AddUnityReferences" BeforeTargets="ResolveAssemblyReferences">
<!--
Priority 1: UNITY_MANAGED_PATH environment variable (explicit override).
Expand All @@ -14,7 +19,7 @@
<!-- Priorities 1 & 2: explicit path -->
<PropertyGroup>
<UnityManagedPath Condition="'$(UNITY_MANAGED_PATH)' != ''">$(UNITY_MANAGED_PATH)</UnityManagedPath>
<UnityManagedPath Condition="'$(UnityManagedPath)' == '' and Exists('$(MSBuildProjectDirectory)/lib/UnityEngine')">$(MSBuildProjectDirectory)/lib/UnityEngine</UnityManagedPath>
<UnityManagedPath Condition="'$(UnityManagedPath)' == '' and Exists('$(MSBuildProjectDirectory)/../lib/UnityEngine')">$(MSBuildProjectDirectory)/../lib/UnityEngine</UnityManagedPath>
</PropertyGroup>

<!-- Collect DLLs from explicit path (priorities 1 or 2) -->
Expand Down
2 changes: 1 addition & 1 deletion Documentation/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"src": [
{
"src": "..",
"src": ".",
"files": [
"DocFxForUnity.csproj"
]
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ online: <https://normanderwan.github.io/DocFxForUnity/>. It references both C# A
## Setup your documentation

1. [Install DocFX](https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html#2-use-docfx-as-a-command-line-tool).
2. Copy the `Documentation/` folder and `DocFxForUnity.csproj` to your Unity project:
2. Copy the `Documentation/` folder to your Unity project:

```diff
.
├── Assets
+ ├── DocFxForUnity.csproj
+ ├── Documentation
├── Package
├── ProjectSettings
└── README.md
```

You can rename `DocFxForUnity.csproj` to match your project — just update the filename in `Documentation/docfx.json` under `metadata[0].src[0].files` accordingly.
You can rename `Documentation/DocFxForUnity.csproj` to match your project — just update the filename in `Documentation/docfx.json` under `metadata[0].src[0].files` accordingly.

3. Edit the following properties in `Documentation/docfx.json`, keep the others as it is:

Expand Down Expand Up @@ -139,7 +138,7 @@ details.

- DocFX outputs: `Warning:[ExtractMetadata]No project detected for extracting metadata.`

Solution: Make sure you copied `DocFxForUnity.csproj` (or your renamed version) to the root of your Unity project, and that the filename matches the entry in `Documentation/docfx.json` under `metadata[0].src[0].files`.
Solution: Make sure `DocFxForUnity.csproj` (or your renamed version) is inside the `Documentation/` folder, and that the filename matches the entry in `Documentation/docfx.json` under `metadata[0].src[0].files`.

- DocFX outputs: `Warning:[ExtractMetadata]No metadata is generated for Assembly-CSharp,Assembly-CSharp-Editor.`

Expand Down Expand Up @@ -170,7 +169,7 @@ details.

## Advanced: `UNITY_MANAGED_PATH`

By default, `DocFxForUnity.csproj` auto-detects the Unity managed DLLs from the standard Unity Hub installation directory. Set `UNITY_MANAGED_PATH` when you need to:
By default, `Documentation/DocFxForUnity.csproj` auto-detects the Unity managed DLLs from the standard Unity Hub installation directory. Set `UNITY_MANAGED_PATH` when you need to:

- Use a Unity version installed at a non-default location.
- Pin to a specific version when multiple Unity versions are installed.
Expand Down
Loading