@@ -244,8 +244,6 @@ There are utility methods for coding source generator more efficient and readabl
244
244
245
245
246
246
``` csharp
247
- using static SatorImaging .UnitySourceGenerator .USGFullNameOf ; // usg<T>() to work
248
-
249
247
// indent utility
250
248
sb .IndentChar (' ' ); // default
251
249
sb .IndentSize (4 ); // default
@@ -259,20 +257,24 @@ sb.IndentBegin("void MethodName() {");
259
257
sb .IndentLine ($" MyObject.EnumValue = {CAST_MY_ENUM }intValue" );
260
258
}
261
259
sb .IndentEnd (" }" );
260
+ ```
261
+
262
+ ``` csharp
263
+ using static SatorImaging .UnitySourceGenerator .USGFullNameOf ; // usg<T>() to work
262
264
263
- // writing with auto completion
265
+ // usg<T>() allows to write refactoring-ready code with auto completion
264
266
sb .Append ($" public static {usg <Dictionary <int , float >>()} MyDict = new() {{ init... }};" );
265
267
266
- // usg<T>{params string[]) to get full type name
267
- usg <MyClass >(" NestedStruct.MyField" ); // -> global::Full.Namespace.To.MyClass.MyStruct.MyField
268
+ // usg<T>{params string[]) to generate full name with specified member name.
269
+ usg <MyClass >(" NestedStruct.MyField" ); // -> global::Full.Namespace.To.MyClass.MyStruct.MyField
268
270
// most strict refactoring-ready code
269
271
usg <MyClass >(nameof (MyClass .NestedStruct ), nameof (MyClass .NestedStruct .MyField ));
270
272
271
- // usg(object) to retrieve full type definition literal
272
- static class ExistingClass {
273
+ // usg(object valueOrType, bool isFullName ) to retrieve full type definition literal
274
+ static class MyClass {
273
275
Dictionary <int , List <Dictionary <string , float [][]>[]>> Complex = new (0 ); // usg() throws when null
274
276
}
275
- sb . Append ( $" ExistingClass.Complex = new { usg (ExistingClass .Complex )}() {{ generated code ... }}; " );
277
+ usg (MyClass .Complex ); // -> global:: ...Dictionary<int, global::...List<global::...Dictionary<string, float[][]>[]>>
276
278
```
277
279
278
280
@@ -294,7 +296,7 @@ There are utility functions to perform source code generation on build event.
294
296
USGUtility .ForceGenerateByName (nameof (MinimalGenerator ));
295
297
296
298
// perform code generation by known path.
297
- USGEngine .ProcessFile (assetPath , true ); // force overwrite
299
+ USGEngine .ProcessFile (assetPath , true , true ); // force overwrite all related generators
298
300
```
299
301
300
302
@@ -366,16 +368,9 @@ Use the following git URL in Unity Package Manager (UPM).
366
368
367
369
## USG Control Panel & Window
368
370
369
- - ` Edit > Project Settings > Alternative Source Generator `
370
-
371
- ![ ] ( https://dl.dropbox.com/scl/fi/jijclnarrruxdt590vss1/USG_Panel.png?rlkey=k44lc9swk0mmui849ck7tappk&dl=0 )
372
-
373
-
374
- - ` Tools > Alternative Source Generator `
375
-
376
- ![ ] ( https://dl.dropbox.com/scl/fi/dedb30699adhss8zqwft5/USG_Window.png?rlkey=13gq24ypciw00o9tkhicdpxpe&dl=0 )
377
-
371
+ - ` Main Menu > Edit > Project Settings > Alternative Source Generator `
378
372
373
+ ![ ] ( https://dl.dropbox.com/scl/fi/jijclnarrruxdt590vss1/USG_Panel.png?rlkey=k44lc9swk0mmui849ck7tappk&dl=0 )
379
374
380
375
381
376
- ** On**
@@ -391,6 +386,12 @@ Use the following git URL in Unity Package Manager (UPM).
391
386
- 🗑️
392
387
- Delete * emitted* file from ` USG.g ` folder.
393
388
389
+ - ` Main Menu > Tools > Alternative Source Generator `
390
+ - open as a window.
391
+
392
+ ![ ] ( https://dl.dropbox.com/scl/fi/dedb30699adhss8zqwft5/USG_Window.png?rlkey=13gq24ypciw00o9tkhicdpxpe&dl=0 )
393
+
394
+
394
395
395
396
## Context Menu
396
397
0 commit comments