Hide
LayoutShowIf / LayoutHideIf
Important
Enable SaintsEditor before using

Show or hide an entire layout group. These attributes will work on the first layout underneath it.

Arguments:

  • (Optional) EMode editorMode

    Condition: if it should be in edit mode, play mode for Editor or in some prefab stage. By default, (omitting this parameter) it does not check the mode at all.

    See Misc - EMode for more information.

  • object by...

    callbacks or attributes for the condition.

  • Allow Multiple: Yes

You can use multiple LayoutShowIf, LayoutHideIf, and even a mix of the two.

For LayoutShowIf: The layout group will be shown if ALL condition is true (and operation)

For LayoutHideIf: The layout group will be hidden if ANY condition is true (or operation)

For multiple attributes: The layout group will be shown if ANY condition is true (or operation)

using SaintsField.Playa; public bool visibleMain; [LayoutShowIf(nameof(visibleMain))] [LayoutStart("Main", ELayout.FoldoutBox)] public bool visible1; [LayoutShowIf(nameof(visible1))] [LayoutStart("./1", ELayout.FoldoutBox, marginBottom: 10)] public int int1; public string string1; [LayoutStart("..")] public bool visible2; [LayoutShowIf(nameof(visible2))] [LayoutStart("./2", ELayout.FoldoutBox)] public int int2; public string string2; [LayoutEnd] [Space] public string layoutEnd;