logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class GameProgressCondition

    Met when the player's global, slot-independent progress says so: an extra was unlocked, the game was completed, or it was completed enough times.

    Inheritance
    object
    GameProgressCondition
    Namespace: Serenity.Achievements.Infrastructure.Conditions
    Assembly: Serenity.UnityAchievements.Infrastructure.dll
    Syntax
    [AchievementConditionCategory(AchievementConditionCategory.Triggers)]
    public class GameProgressCondition : AchievementCondition
    Remarks

    Keeps no state: GameProgress already persists all three answers, so this leaf only reads. It is also the honest answer to "unlock when the player beats the final boss" — the game calls IncrementCompletionCount when the boss dies, and the rule is authored here.

    Constructors

    GameProgressCondition()

    Creates an unauthored condition, as Unity's polymorphic serializer does.

    Declaration
    public GameProgressCondition()

    GameProgressCondition(GameProgressConditionMode, string, int)

    Creates a condition reading the player's global progress.

    Declaration
    public GameProgressCondition(GameProgressConditionMode mode, string extraId = null, int requiredCount = 1)
    Parameters
    Type Name Description
    GameProgressConditionMode mode

    Which question is asked.

    string extraId

    The extra whose unlock is required, for the extra mode.

    int requiredCount

    How many completions are required, for the count mode.

    Properties

    DisplayName

    Declaration
    public override string DisplayName { get; }
    Property Value
    Type Description
    string

    ExtraId

    The extra whose unlock is required.

    Declaration
    public string ExtraId { get; }
    Property Value
    Type Description
    string

    Mode

    Which question this condition asks.

    Declaration
    public GameProgressConditionMode Mode { get; }
    Property Value
    Type Description
    GameProgressConditionMode

    NeedsTick

    Polled, for the same reason ScoreThresholdCondition is: global progress changes without this leaf being told, so it has to be asked.

    Declaration
    public override bool NeedsTick { get; }
    Property Value
    Type Description
    bool

    RequiredCount

    How many completions are required.

    Declaration
    public int RequiredCount { get; }
    Property Value
    Type Description
    int

    Methods

    Describe(bool)

    Declaration
    public override string Describe(bool isNested)
    Parameters
    Type Name Description
    bool isNested
    Returns
    Type Description
    string

    GetProgress(in AchievementEvaluationContext)

    Declaration
    public override AchievementConditionProgress GetProgress(in AchievementEvaluationContext context)
    Parameters
    Type Name Description
    AchievementEvaluationContext context
    Returns
    Type Description
    AchievementConditionProgress

    IsMet(in AchievementEvaluationContext)

    Declaration
    public override bool IsMet(in AchievementEvaluationContext context)
    Parameters
    Type Name Description
    AchievementEvaluationContext context
    Returns
    Type Description
    bool

    Validate()

    Declaration
    public override string Validate()
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved