logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct AchievementsStudioRowTraits

    What one achievement awards and how it behaves, as a list row reads it: the points, and the three things that change how an author has to think about it.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Achievements.Infrastructure.Editor.Studio
    Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
    Syntax
    public readonly struct AchievementsStudioRowTraits
    Remarks

    One value rather than four parameters on the row, because three of them are booleans and a row built from (10, true, false, true) is a row nobody can read at the call site — and a row whose isHidden and isProgressive got swapped is a defect no compiler can see. Grouping them puts the naming burden in one place: Of(UnityAchievementDefinition) is the only production path, and everything else names its arguments.

    Constructors

    AchievementsStudioRowTraits(int, bool, bool, bool)

    Creates a set of traits.

    Declaration
    public AchievementsStudioRowTraits(int points, bool isHidden, bool isProgressive, bool isCodeUnlocked)
    Parameters
    Type Name Description
    int points

    The points an unlock awards.

    bool isHidden

    Whether it stays concealed until unlocked.

    bool isProgressive

    Whether it accumulates progress.

    bool isCodeUnlocked

    Whether only code or a signal unlocks it.

    Fields

    IsCodeUnlocked

    Whether nothing but a code call or an unlock signal unlocks it.

    Declaration
    public readonly bool IsCodeUnlocked
    Field Value
    Type Description
    bool

    IsHidden

    Whether the achievement stays concealed in the listing until it is unlocked.

    Declaration
    public readonly bool IsHidden
    Field Value
    Type Description
    bool

    IsProgressive

    Whether it unlocks by accumulating progress rather than in one step.

    Declaration
    public readonly bool IsProgressive
    Field Value
    Type Description
    bool

    Points

    The points an unlock awards.

    Declaration
    public readonly int Points
    Field Value
    Type Description
    int

    Methods

    Of(UnityAchievementDefinition)

    Reads the traits off an authored achievement.

    Declaration
    public static AchievementsStudioRowTraits Of(UnityAchievementDefinition definition)
    Parameters
    Type Name Description
    UnityAchievementDefinition definition

    The achievement to read. Must not be null.

    Returns
    Type Description
    AchievementsStudioRowTraits

    Its traits.

    Remarks

    A positive progress target is what makes an achievement progressive: zero means it unlocks in one step, which is the module's own reading of the field. An achievement with no authored condition is code-unlocked, which is a complete and normal way to author one rather than an omission.

    In this article
    © 2026 Serenity. All Rights Reserved