本文整理汇总了C#中Achievement.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# Achievement.Clear方法的具体用法?C# Achievement.Clear怎么用?C# Achievement.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Achievement
的用法示例。
在下文中一共展示了Achievement.Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearAchievementTest
/// <summary>
/// Checks if clearing of an Achievement works as designed
/// </summary>
private static void ClearAchievementTest()
{
// create AchievementConditions
AchievementCondition achievementCondition = new AchievementCondition("acUniqueId", "acKey", 5);
AchievementCondition achievementCondition2 = new AchievementCondition("acUniqueId2", "acKey", 5);
string uniqueId = "aUniqueId";
string atitel = "aTitel";
string adescription = "aDescription";
// create Achievement
Achievement a = new Achievement(uniqueId, atitel, adescription, new List<AchievementCondition> { achievementCondition, achievementCondition2 });
// check of Achievement has both AchievementConditions
Debug.Assert(a.Conditions.Count() == 2, "a.Conditions.Count == 2");
// clear Achievement
a.Clear();
// Check if Conditions are gone
Debug.Assert(!a.Conditions.Any(), "!a.Conditions.Any()");
}