float GlobalFraction { get; set; }

robot_2Generated
code_blocksInput

Description

The GlobalFraction property of the Achievement class represents the percentage of players who have unlocked this particular achievement. It is a floating-point value ranging from 0.0 to 1.0, where 0.0 indicates that no players have unlocked the achievement, and 1.0 indicates that all players have unlocked it.

Usage

Use the GlobalFraction property to determine the rarity of an achievement among the player base. This can be useful for displaying statistics or for creating dynamic content based on achievement rarity.

Example

// Example of accessing the GlobalFraction property
Achievement achievement = new Achievement();
float globalFraction = achievement.GlobalFraction;

// Display the percentage of players who have unlocked the achievement
float percentage = globalFraction * 100;
string message = $"{percentage}% of players have unlocked this achievement.";