diff --git a/Source/Editor/Utilities/Utils.cs b/Source/Editor/Utilities/Utils.cs index e34f01eca..f0bce9ac6 100644 --- a/Source/Editor/Utilities/Utils.cs +++ b/Source/Editor/Utilities/Utils.cs @@ -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) { diff --git a/Source/Tools/FlaxEngine.Tests/TestPropertyNameUI.cs b/Source/Tools/FlaxEngine.Tests/TestPropertyNameUI.cs index ef7ecaa41..e51905ff2 100644 --- a/Source/Tools/FlaxEngine.Tests/TestPropertyNameUI.cs +++ b/Source/Tools/FlaxEngine.Tests/TestPropertyNameUI.cs @@ -11,10 +11,10 @@ namespace FlaxEditor.Tests [Test] public void TestFormatting() { - Assert.AreEqual("property", Utils.GetPropertyNameUI("property")); - Assert.AreEqual("property", Utils.GetPropertyNameUI("_property")); - Assert.AreEqual("property", Utils.GetPropertyNameUI("m_property")); - Assert.AreEqual("property", Utils.GetPropertyNameUI("g_property")); + Assert.AreEqual("Property", Utils.GetPropertyNameUI("property")); + Assert.AreEqual("Property", Utils.GetPropertyNameUI("_property")); + Assert.AreEqual("Property", Utils.GetPropertyNameUI("m_property")); + Assert.AreEqual("Property", Utils.GetPropertyNameUI("g_property")); Assert.AreEqual("Property", Utils.GetPropertyNameUI("Property")); Assert.AreEqual("Property 1", Utils.GetPropertyNameUI("Property1")); Assert.AreEqual("Property Name", Utils.GetPropertyNameUI("PropertyName"));