DisplayStringFormatAttribute.cs 751 B

12345678910111213141516171819202122
  1. using System;
  2. namespace UnityEngine.InputSystem.Utilities
  3. {
  4. /// <summary>
  5. /// Provide a format string to use when creating display strings for instances of the class.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Class, Inherited = true)]
  8. public class DisplayStringFormatAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// Format template string in the form of "{namedPart} verbatimText". All named parts enclosed in
  12. /// curly braces are replaced from context whereas other text is included as is.
  13. /// </summary>
  14. public string formatString { get; set; }
  15. public DisplayStringFormatAttribute(string formatString)
  16. {
  17. this.formatString = formatString;
  18. }
  19. }
  20. }