You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+90-6
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,9 @@ Alternative Source Generator is built on the Unity native functions.
11
11
12
12
As you already know, Roslyn's source generator is too sophisticated. This framework provides more simple, ease of use and good enough functions for source code generation.
@@ -27,12 +30,14 @@ As you already know, Roslyn's source generator is too sophisticated. This framew
27
30
-[Generic Generator](#generic-generator)
28
31
-[Result](#result-1)
29
32
-[Output Directory and File Name](#output-directory-and-file-name)
33
+
-[Coding Goodies](#coding-goodies)
30
34
-[Utility Functions for Build](#utility-functions-for-build)
31
35
-[Technical Notes](#technical-notes)
32
36
-[Naming Convention](#naming-convention)
33
37
-[`<auto-generated/>` Tag](#auto-generated-tag)
34
38
-[Installation](#installation)
35
39
-[Editor Extensions](#editor-extensions)
40
+
-[Troubleshooting](#troubleshooting)
36
41
-[Copyright](#copyright)
37
42
-[License](#license)
38
43
-[Devnote](#devnote)
@@ -45,7 +50,8 @@ As you already know, Roslyn's source generator is too sophisticated. This framew
45
50
46
51
47
52
48
-
# Sample Code
53
+
Sample Code
54
+
===========
49
55
50
56
Minimal implementation codes of source generator.
51
57
@@ -176,7 +182,8 @@ Hello World from Sample.MinimalGenerator
176
182
```
177
183
178
184
179
-
# Output Directory and File Name
185
+
Output Directory and File Name
186
+
==============================
180
187
181
188
Source Generator creates `USG.g` folder next to target script and append class names to file name.
182
189
@@ -196,7 +203,68 @@ Resulting file path will be:
196
203
197
204
198
205
199
-
# Utility Functions for Build
206
+
Coding Goodies
207
+
==============
208
+
209
+
There are utility methods for coding source generator more efficient and readable.
210
+
211
+
-`StringBuilder` Extentions
212
+
-`IndentLine` / `IndentAppend`
213
+
-`IndentLevel` / `IndentChar` / `IndentSize`
214
+
-`IndentBegin` / `IndentEnd`
215
+
-`USGFullNameOf`
216
+
-`usg`
217
+
-`USGReflection`
218
+
-`GetAllPublicInstanceFieldAndProperty`
219
+
-`TryGetFieldOrPropertyType`
220
+
-`GetEnumNamesAndValuesAsDictionary`
221
+
-`GetEnumNamesAndValuesAsTuple`
222
+
223
+
`usg` is a special utility that is designed for refactoring-ready source generator more readable, script template import it as a static library by default.
As of C# 9.0, it doesn't allow to define `abstract static` methods in interface, USG reports error when source generator class doesn't implement required static methods.
224
293
@@ -271,7 +340,8 @@ USG automatically adds document tag at the beginning of generated file. You can
271
340
272
341
273
342
274
-
# Installation
343
+
Installation
344
+
============
275
345
276
346
Use the following git URL in Unity Package Manager (UPM).
277
347
@@ -280,7 +350,8 @@ Use the following git URL in Unity Package Manager (UPM).
0 commit comments