Display As String Attribute

DisplayAsString is used on any property, and displays a string in the inspector as text. Use this for when you want to show a string in the inspector, but not allow for any editing.

[InfoBox( "Instead of disabling values in the inspector in order to show some information or debug a value. " + "You can use DisplayAsString to show the value as text, instead of showing it in a disabled drawer")] [DisplayAsString] public Color SomeColor; [BoxGroup("SomeBox")] [HideLabel] [DisplayAsString] public string SomeText = "Lorem Ipsum"; [InfoBox("The DisplayAsString attribute can also be configured to enable or disable overflowing to multiple lines.")] [HideLabel] [DisplayAsString] public string Overflow = "A very very very very very very very very very long string that has been configured to overflow."; [HideLabel] [DisplayAsString(false)] public string DisplayAllOfIt = "A very very very very very very very very long string that has been configured to not overflow."; [InfoBox("Additionally, you can also configure the string's alignment, font size, and whether it should support rich text or not.")] [DisplayAsString(false, 20, TextAlignment.Center, true)] public string CustomFontSizeAlignmentAndRichText = "This string is <b><color=#FF5555><i>super</i> <size=24>big</size></color></b> and centered.";