Skip to content

Commit 7054117

Browse files
author
András Kurai
committed
add remaining documentation
1 parent 73bee1c commit 7054117

File tree

6 files changed

+61
-2
lines changed

6 files changed

+61
-2
lines changed

.vscode/spellright.dict

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
unrecoverably
2+
parameterless

Documentation/api/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# PLACEHOLDER
2-
TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!
1+
# C# API Documentation

Documentation/articles/Customization.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,46 @@
33
After pressing the `Generate Resource Paths` button, or visiting the `ResourceGenerator` page in the Project Settings an asset will be generated in the Assets folder, which will contain settings for the code generation.
44

55
## Built-in settings
6+
7+
![Generate Button](~/images/Customization/DefaultSettings.png)
8+
9+
### Basic settings
10+
11+
- **Folder from Assets**: Relative path to the folder where you want the generated class
12+
- **Namespace**: The namespace of the generated class
13+
- **Class name**: The name of the generated class. The file name will be the same
14+
- **Log Infos**: Whether to log Info level logs. Turned off by default
15+
- **Log Errors**: Whether to log Error level logs. Turned on by default
16+
17+
### Advanced settings
18+
19+
> [!NOTE]
20+
> If you unrecoverably mess up your settings press the `Reset file mappings` button to restore the default file mappings
21+
22+
The data section describes the automatically generated file mappings. The data is an array. For each element of the array it will create a new inner class of the main generated one.
23+
24+
- **Class Name**: The name of the generated class
25+
- **File Extensions**: Search pattern for the files
26+
- **Data Type**: The C# type returned by `Resurces.Load`
27+
28+
The default mappings are created from the [Unity documentation](https://docs.unity3d.com/Manual/BuiltInImporters.html). If you know of any valid file mapping that the documentation does not state, please fork and create a Pull Request, or create an [Issue](https://github.com/AutSoft/UnityResourceGenerator/issues/new).
29+
30+
## Extending the generated classes
31+
32+
The generated classes are `partial` by default. This means that if you want to add custom methods, simply create another `partial` class and add your code there.
33+
34+
```csharp
35+
public static partial class ResourcePaths
36+
{
37+
public static partial class Scenes
38+
{
39+
public static string[] MainScenes { get; } = new []
40+
{
41+
Coins,
42+
Level1,
43+
Level2,
44+
// ...
45+
}
46+
}
47+
}
48+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Extensibility
2+
3+
The library lets you to inject code into the generation pipeline. To access this feature, create a new Editor project, and reference `AutSoft.UnityResourceGenerator.Editor`. The included functionality is implemented using these mehtods.
4+
5+
## Module generation
6+
7+
A module is single string that is placed inside the main generated class. To create a custom module implement the [IModuleGenerator](xref:AutSoft.UnityResourceGenerator.Editor.Generation.IModuleGenerator) interface. The implementation must provide a parameterless constructor.
8+
9+
## Post processing
10+
11+
A post processor is a piece of code that is run after all modules are produced, and the final file text is created. To create a post processor implement the [IResourcePostProcessor](xref:AutSoft.UnityResourceGenerator.Editor.Generation.IResourcePostProcessor) interface. The implementation must provide a parameterless constructor.
12+
13+
The input of the processor is the current state of the generated file and it returns the new state of the generated file. Post processors also provide a Priority property which determines the ordering of them.

Documentation/articles/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
href: GettingStarted.md
33
- name: Customization
44
href: Customization.md
5+
- name: Extensibility
6+
href: Extensibility.md
61.1 KB
Loading

0 commit comments

Comments
 (0)