コード例 #1
0
    void testAchievements(SessionClient session)
    {
        Client.Achievements((AchievementList a) => {
            IEnumerator <Achievement> en = a.GetEnumerator();
            en.MoveNext();

            Debug.Log("Achievements Count: " + a.Count + " " + en.Current.Name);
        }, failure);

        session.Achievement(achievementId, () => {
            Debug.Log("Updated achievement");

            session.Achievements((AchievementList al) => {
                Debug.Log("Retrieved achievements " + al.Count);
                foreach (Achievement entry in al.Achievements)
                {
                    Debug.LogFormat("Name: " + entry.Name + " state: " + entry.State);
                    Debug.LogFormat("iscompleted: " + entry.IsCompleted());
                }
            }, failure);
        }, (Achievement a) => {
            Debug.Log("Unlocked achievement");
        }, failure);

        session.Achievements((AchievementList al) => {
            Debug.Log("Retrieved achievements " + al.Count);
            foreach (Achievement entry in al.Achievements)
            {
                Debug.LogFormat("Name: " + entry.Name + " state: " + entry.State);
            }
        }, failure);
    }