RockTomate / Issues

Submit bugs and feature requests.
4 stars 1 forks source link

Capitalize first letter of FieldAttributes #7

Closed DmitriyYukhanov closed 4 years ago

DmitriyYukhanov commented 4 years ago

Feature Proposal It's pretty annoying current way FieldAttributes are printed in Inspector forces to use specific coding style when naming those fields.

For example, I prefer lowerCase for public fields and if I declare it like this:

[InputField]
public string variableName;

I'll get variable Name in the Inspector. I'd like to have first letter always capitalized no matter how I write it in code, this is a default Unity behaviour which we are used to.

I'd propose to use something like this to make it possible:

public static string NicifyName(string name)
{
    var nicePropertyName = ObjectNames.NicifyVariableName(name);
    if (textInfo == null) textInfo = new CultureInfo("en-US", false).TextInfo;
    return textInfo.ToTitleCase(nicePropertyName);
}

Problem this Solves Allows to use any coding style while making custom Steps and such.

ElmarTalibzade commented 4 years ago

Thanks for this. All exposed variables now get "prettified" in the same manner as public fields in Unity's default inspector.

Implemented in 1.0.2