Skip to content

Commit a4add5e

Browse files
committed
chore: clarify and docs
1 parent d2d1b04 commit a4add5e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Editor/USGEngine.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ public static bool ProcessFile(string assetsRelPath)
213213
{
214214
Span<byte> buffer = stackalloc byte[BUFFER_LENGTH];
215215
var span = sb.ToString().AsSpan();
216-
for (int i = 0; i < span.Length; i += BUFFER_MAX_CHAR_LENGTH)
216+
for (int start = 0; start < span.Length; start += BUFFER_MAX_CHAR_LENGTH)
217217
{
218218
var len = BUFFER_MAX_CHAR_LENGTH;
219-
if (len + i > span.Length) len = span.Length - i;
219+
if (len + start > span.Length) len = span.Length - start;
220220

221-
int written = info.Attribute.OutputFileEncoding.GetBytes(span.Slice(i, len), buffer);
221+
int written = info.Attribute.OutputFileEncoding.GetBytes(span.Slice(start, len), buffer);
222222
fs.Write(buffer.Slice(0, written));
223223
}
224224
fs.Flush();

Editor/USGUtility.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public static void ForceGenerateInEditor(string clsName, bool showInProjectPanel
3939
}
4040

4141

42-
///<summary>Returns "Assets/" rooted path of the script file.</summary>
42+
///<summary>Returns "Assets/" or "Packages/" starting path to the script. (relative path from Unity project directory)</summary>
43+
///<returns>null if not found</returns>
4344
public static string GetAssetPathByName(string clsName)
4445
{
4546
var GUIDs = AssetDatabase.FindAssets(clsName);

0 commit comments

Comments
 (0)