logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AchievementConditionTreeGui

    Draws a whole authored unlock condition tree: the findings about it, the tree itself, and the controls that start one or throw one away.

    Inheritance
    object
    AchievementConditionTreeGui
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Achievements.Infrastructure.Editor
    Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
    Syntax
    public static class AchievementConditionTreeGui
    Remarks

    The entry point every tool that edits a condition uses — the achievement inspector today, an authoring wizard next — so a tree looks and behaves the same wherever it is edited, the way ScoreMetricsTableGui is one metrics table rather than two that resemble each other.

    The one thing this class does before drawing anything is refuse a tree that cannot be walked. [SerializeReference] stores a graph, so a corrupted or hand-edited asset can make a node its own descendant, and the recursion below would then run until the stack ends. Everything past the guard is known to be a tree.

    Fields

    AddConditionLabel

    The button that gives an achievement with no condition its first node.

    Declaration
    public const string AddConditionLabel = "Add condition"
    Field Value
    Type Description
    string

    ClearConditionLabel

    The button that takes the whole tree away again.

    Declaration
    public const string ClearConditionLabel = "Remove condition"
    Field Value
    Type Description
    string

    NoConditionNote

    What an achievement with no authored condition means, said where it is missing.

    Declaration
    public const string NoConditionNote = "This achievement has no unlock condition. Only a code call to IAchievementService.UnlockAsync or an UnlockAchievementSignal unlocks it, which is a complete and normal way to author one."
    Field Value
    Type Description
    string

    ResetTreeLabel

    The button that clears a tree too broken to draw.

    Declaration
    public const string ResetTreeLabel = "Reset tree"
    Field Value
    Type Description
    string

    Methods

    Draw(SerializedProperty, AchievementConditionEditContext, IReadOnlyList<AuthoringIssue>)

    Draws the tree hanging off a condition property.

    Declaration
    public static void Draw(SerializedProperty conditionProperty, AchievementConditionEditContext context, IReadOnlyList<AuthoringIssue> issues)
    Parameters
    Type Name Description
    SerializedProperty conditionProperty

    The achievement's root condition property.

    AchievementConditionEditContext context

    What the drawer writes, dirties and notifies through.

    IReadOnlyList<AuthoringIssue> issues

    Findings about the whole achievement; only the condition ones are shown here.

    IsConditionFinding(AuthoringIssue)

    Whether a finding belongs to the condition tree rather than to the rest of the asset.

    Declaration
    public static bool IsConditionFinding(AuthoringIssue finding)
    Parameters
    Type Name Description
    AuthoringIssue finding

    The finding to classify. May be null.

    Returns
    Type Description
    bool

    True when the finding is about the condition.

    Remarks

    Public so the inspector drawing the other findings and this drawer agree on one split instead of each owning a predicate that could drift and either double a finding or drop it.

    In this article
    © 2026 Serenity. All Rights Reserved