Skip to content

Commit 9fe5523

Browse files
committed
docs
1 parent 1382ae6 commit 9fe5523

File tree

2 files changed

+37
-28
lines changed

2 files changed

+37
-28
lines changed

CHANGELOG.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Breaking Changes ;-)
1515

16-
- *USGEngine*.`ProcessFile(string assetsRelPath)`
17-
👉 signature changed: `ProcessFile(string assetsRelPath,
18-
bool ignoreOverwriteSettingOnAttribute, bool autoRunReferencingEmittersNow = false)`
16+
#### USGEngine.ProcessFile(string assetsRelPath)
1917

20-
- ~~public~~ static bool *USGEngine*.`IgnoreOverwriteSettingByAttribute`
21-
👉 now private. use <code>ProcessFile(path, **true**)</code> instead.
18+
signature changed:
19+
- `ProcessFile(string assetsRelPath, bool ignoreOverwriteSettingOnAttribute, bool autoRunReferencingEmittersNow = false)`
2220

23-
- *USGUtility*.<code>ForceGenerateByName(string clsName, bool showInProjectPanel = **false**)</code>
24-
👉 now false by default.
21+
#### ~~public~~ static bool USGEngine.IgnoreOverwriteSettingByAttribute
2522

26-
- `usg(Type cls, params string[] memberNames)`
27-
👉 signature changed: `usg(object obj, bool isFullName = true)`
28-
👉 `global::` namespace will be added.
23+
now private. use `ProcessFile(path, *true*)` instead.
24+
25+
#### USGUtility.ForceGenerateByName(string clsName, bool showInProjectPanel = *false*)
26+
27+
`showInProjectPanel` now false by default.
28+
29+
#### usg<T>(params string[] memberNames)
30+
31+
`global::` namespace will be added.
32+
33+
#### usg(Type cls, params string[] memberNames)
34+
35+
signature changed:
36+
- `usg(object valueOrType, bool isFullName = true)`

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ There are utility methods for coding source generator more efficient and readabl
244244

245245

246246
```csharp
247-
using static SatorImaging.UnitySourceGenerator.USGFullNameOf; // usg<T>() to work
248-
249247
// indent utility
250248
sb.IndentChar(' '); // default
251249
sb.IndentSize(4); // default
@@ -259,20 +257,24 @@ sb.IndentBegin("void MethodName() {");
259257
sb.IndentLine($"MyObject.EnumValue = {CAST_MY_ENUM}intValue");
260258
}
261259
sb.IndentEnd("}");
260+
```
261+
262+
```csharp
263+
using static SatorImaging.UnitySourceGenerator.USGFullNameOf; // usg<T>() to work
262264
263-
// writing with auto completion
265+
// usg<T>() allows to write refactoring-ready code with auto completion
264266
sb.Append($"public static {usg<Dictionary<int, float>>()} MyDict = new() {{ init... }};");
265267

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
268270
// most strict refactoring-ready code
269271
usg<MyClass>(nameof(MyClass.NestedStruct), nameof(MyClass.NestedStruct.MyField));
270272

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 {
273275
Dictionary<int, List<Dictionary<string, float[][]>[]>> Complex = new(0); // usg() throws when null
274276
}
275-
sb.Append($"ExistingClass.Complex = new {usg(ExistingClass.Complex)}() {{ generated code... }};");
277+
usg(MyClass.Complex); // -> global::...Dictionary<int, global::...List<global::...Dictionary<string, float[][]>[]>>
276278
```
277279

278280

@@ -294,7 +296,7 @@ There are utility functions to perform source code generation on build event.
294296
USGUtility.ForceGenerateByName(nameof(MinimalGenerator));
295297

296298
// perform code generation by known path.
297-
USGEngine.ProcessFile(assetPath, true); // force overwrite
299+
USGEngine.ProcessFile(assetPath, true, true); // force overwrite all related generators
298300
```
299301

300302

@@ -366,16 +368,9 @@ Use the following git URL in Unity Package Manager (UPM).
366368

367369
## USG Control Panel & Window
368370

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`
378372

373+
![](https://dl.dropbox.com/scl/fi/jijclnarrruxdt590vss1/USG_Panel.png?rlkey=k44lc9swk0mmui849ck7tappk&dl=0)
379374

380375

381376
- **On**
@@ -391,6 +386,12 @@ Use the following git URL in Unity Package Manager (UPM).
391386
- 🗑️
392387
- Delete *emitted* file from `USG.g` folder.
393388

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+
394395

395396
## Context Menu
396397

0 commit comments

Comments
 (0)