The UnlockTimestamp
property of the Achievement
class represents the date and time when the achievement was unlocked. It is a nullable property, meaning it can hold a null
value if the achievement has not been unlocked yet.
The UnlockTimestamp
property of the Achievement
class represents the date and time when the achievement was unlocked. It is a nullable property, meaning it can hold a null
value if the achievement has not been unlocked yet.
Use the UnlockTimestamp
property to determine when an achievement was unlocked. This can be useful for tracking player progress over time or for displaying the unlock date in a user interface.
To check if an achievement has been unlocked, you can verify if UnlockTimestamp
has a value:
if (achievement.UnlockTimestamp.HasValue)
{
// Achievement is unlocked
DateTimeOffset unlockTime = achievement.UnlockTimestamp.Value;
// Use unlockTime as needed
}
else
{
// Achievement is not unlocked
}
// Example of accessing the UnlockTimestamp property Achievement achievement = new Achievement(); // Check if the achievement is unlocked if (achievement.UnlockTimestamp.HasValue) { // Output the unlock timestamp DateTimeOffset unlockTime = achievement.UnlockTimestamp.Value; Console.WriteLine($"Achievement unlocked on: {unlockTime}"); } else { Console.WriteLine("Achievement not unlocked yet."); }