logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ScoreKeyFieldGui

    Renders a score-metric-key field as a pick-from-what-exists control instead of a bare text field: a popup over DiscoverKeys() with a manual entry underneath for keys the scan cannot see. Shared by the leaderboard wizard, the achievements wizard and the achievements condition drawer, so every field asking for a score key offers the same choices.

    Inheritance
    object
    ScoreKeyFieldGui
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Score.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityScore.Infrastructure.Editor.dll
    Syntax
    public static class ScoreKeyFieldGui

    Methods

    DrawKeyPopup(GUIContent, string, IReadOnlyList<string>, bool)

    The popup alone: the current custom value stays pinned as its own entry so rendering never destroys a hand-typed key the scan does not know about.

    Declaration
    public static string DrawKeyPopup(GUIContent label, string currentKey, IReadOnlyList<string> detectedKeys, bool allowNone)
    Parameters
    Type Name Description
    GUIContent label

    The field label.

    string currentKey

    The currently stored key.

    IReadOnlyList<string> detectedKeys

    The discovered keys to offer.

    bool allowNone

    Whether an explicit "(none)" entry clears the key.

    Returns
    Type Description
    string

    The key after this frame's pick.

    DrawKeyProperty(SerializedProperty, string)

    The serialized-property variant for inspector drawers: a required key rendered as the popup plus the property itself as the manual entry, with hint as a muted footnote.

    Declaration
    public static void DrawKeyProperty(SerializedProperty keyProperty, string hint)
    Parameters
    Type Name Description
    SerializedProperty keyProperty

    The string property holding the key.

    string hint

    The muted guidance rendered under the field.

    DrawOptionalKeyField(GUIContent, string)

    A key field whose empty value is meaningful (a disabled feature): popup with a "(none)" entry plus a manual field. Falls back to a plain text field when no keys were discovered.

    Declaration
    public static string DrawOptionalKeyField(GUIContent label, string currentKey)
    Parameters
    Type Name Description
    GUIContent label

    The field label.

    string currentKey

    The currently stored key.

    Returns
    Type Description
    string

    The key after this frame's edits.

    In this article
    © 2026 Serenity. All Rights Reserved