Hide
InfoBox/BelowInfoBox
Important
Enable SaintsEditor before using

Draw an info box above/below the field.

It can also be directly applied on a class/struct definition, to act like a comment.

  • string content

    The content of the info box.

    If it starts with $, the leading $ will be removed and isCallback will be set to true. Use \$ to escape the starting $.

  • EMessageType messageType=EMessageType.Info

    Message icon. Options are

    • None
    • Info
    • Warning
    • Error
  • string show=null

    a callback name or property name for show or hide this info box.

  • bool isCallback=false

    if true, the content will be interpreted as a property/callback function.

    If the value (or returned value) is a string, then the content will be changed

    If the value is (EMessageType messageType, string content) then both content and message type will be changed

  • bool below=false

    Draw the info box below the field instead of above

  • string groupBy="" See GroupBy section

  • AllowMultiple: Yes

// Please ensure you already have SaintsEditor enabled in your project before trying this example using SaintsField.Playa; [InfoBox("Please Note: special label like <icon=star.png/> only works for <color=lime>UI Toolkit</color> <color=red>(not IMGUI)</color> in InfoBox.")] [BelowInfoBox("
quot;
+ nameof(DynamicFromArray))] // callback public string[] strings = {}; public string dynamic; private string DynamicFromArray(string[] value) => value.Length > 0? string.Join("\n", value): "null"; [InfoBox("MethodWithButton")] [Button("Click Me!")] [BelowInfoBox("GroupExample", groupBy: "group")] [BelowInfoBox("
quot;
+ nameof(dynamic), groupBy: "group")] public void MethodWithButton() { } [InfoBox("Method")] [BelowInfoBox("
quot;
+ nameof(dynamic))] public void Method() { }

image

Example of using on a class/struct definition like a data comment:

using SaintsField; using SaintsField.Playa; [InfoBox("This is a class message", EMessageType.None)] [InfoBox("
quot;
+ nameof(dynamicContent))] public class ClassInfoBoxExample : MonoBehaviour // The info box will show in inspector wherever you attach this component { public string dynamicContent; [Serializable] [InfoBox("This is a struct message")] public struct MyStruct // The info box will show at first row wherever you use this struct { public string structString; } public MyStruct myStruct; }

Image