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
///<summary>UNSAFE on use in build event due to this method calls fancy UI methods and fire import event. Use `GetAssetPathByName()` instead.</summary>
Copy file name to clipboardexpand all lines: README.md
+20-6
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,8 @@ As you already know, Roslyn's source generator is too sophisticated. This framew
36
36
-[Copyright](#copyright)
37
37
-[License](#license)
38
38
-[Devnote](#devnote)
39
+
-[TODO](#todo)
40
+
-[Memo](#memo)
39
41
40
42
<!------- End of Details EN Tag -------></details></p>
41
43
@@ -132,7 +134,7 @@ namespace Sample
132
134
133
135
Here is target-less generator example.
134
136
135
-
It is useful to generate static database that cannot be generated on Unity runtime. For example, asset GUIDs database, resource integrity tables, etc.
137
+
It is useful to generate static database that cannot be generated on Unity runtime. For example, build asset GUIDs database using `UnityEditor.AssetDatabase`, resource integrity tables, etc.
136
138
137
139
138
140
@@ -206,12 +208,12 @@ There are utility functions to perform source code generation on build event.
206
208
207
209
208
210
```csharp
209
-
// perform by known asset path.
210
-
USGEngine.IgnoreOverwriteSettingByAttribute=true; // force overwrite
211
-
USGEngine.ProcessFile(pathToGeneratorScriptFile);
211
+
// search by class name if you don't know where it is.
USGEngine.IgnoreOverwriteSettingByAttribute=true; // force overwrite
216
+
USGEngine.ProcessFile(assetPath);
215
217
```
216
218
217
219
@@ -355,4 +357,16 @@ SOFTWARE.
355
357
356
358
# Devnote
357
359
360
+
361
+
## TODO
362
+
363
+
- Add new attribute option `UseCustomWriter` to use it's own file writer instead of builtin writer. For the "non-allocation" addicted developers.
364
+
-`USGEngine.ProcessingFile()` doesn't care what happens in custom writer. just returns true in this situation.
365
+
- Option is for generator class. Referenced generator class doesn't have `UnitySourceGenerator` attribute so that need to retrieve it from target classes. (how handle conflicts?)
366
+
-`USGContext.UseCustomWriter` can be used to prevent writing file but `StringBuilder` is built prior to `Emit()` method.
367
+
368
+
369
+
370
+
## Memo
371
+
358
372
Unity doesn't invoke import event if Visual Studio is not launch by current session of Unity...?
0 commit comments