Merge branch 'first-capital-letter-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-first-capital-letter-fix

This commit is contained in:
Wojciech Figat
2023-01-13 12:20:57 +01:00
2 changed files with 13 additions and 4 deletions

View File

@@ -906,12 +906,21 @@ namespace FlaxEditor.Utilities
if (name.StartsWith("g_") || name.StartsWith("m_"))
startIndex = 2;
if (name.StartsWith("_"))
startIndex = 1;
// Filter text
var lastChar = '\0';
for (int i = startIndex; i < length; i++)
{
var c = name[i];
if (i == startIndex)
{
sb.Append(char.ToUpper(c));
continue;
}
// Space before word starting with uppercase letter
if (char.IsUpper(c) && i > 0)
{