Exemplo n.º 1
0
        private void OnRequestAchievementsCompleted(AGSRequestAchievementsResponse response)
        {
            if (loadAchievementDescriptionsCallbacks.ContainsKey(response.userData))
            {
                var callback = loadAchievementDescriptionsCallbacks[response.userData];
                if (callback != null)
                {
                    var descriptions = new IAchievementDescription[response.achievements.Count];
                    for (var i = 0; i < response.achievements.Count; i++)
                    {
                        descriptions[i] = new AGSSocialAchievement(response.achievements[i]);
                    }

                    callback(descriptions);
                }

                loadAchievementDescriptionsCallbacks.Remove(response.userData);
            }
            else if (loadAchievementsCallbacks.ContainsKey(response.userData))
            {
                var callback = loadAchievementsCallbacks[response.userData];
                if (callback != null)
                {
                    var achievements = new IAchievement[response.achievements.Count];
                    for (var i = 0; i < response.achievements.Count; i++)
                    {
                        achievements[i] = new AGSSocialAchievement(response.achievements[i]);
                    }

                    callback(achievements);
                }

                loadAchievementsCallbacks.Remove(response.userData);
            }
        }
Exemplo n.º 2
0
 private void HandleAchievementDescriptionsLoaded(IAchievementDescription[] achievementDescriptions)
 {
     Debug.Log("*** HandleAchievementDescriptionsLoaded");
     foreach (IAchievementDescription achievementDescription in achievementDescriptions)
     {
         Debug.Log("* achievementDescription = " + achievementDescription.ToString());
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// Gets the achievement's icon or a default one.
    /// </summary>
    /// <returns>The achievement's icon.</returns>
    static Texture2D GetIcon(IAchievementDescription description)
    {
        var icon = description.image;

        // Try using a default image, if one's set.
        if (icon == null)
        {
            icon = LumosSocialGUI.defaultAchIcon;
        }

        return(icon);
    }
Exemplo n.º 4
0
 public void LoadAchievementDescriptions(Action <IAchievementDescription[]> callback)
 {
     if (!this.IsAuthenticated())
     {
         Logger.e("LoadAchievementDescriptions can only be called after authentication.");
         callback((IAchievementDescription[])null);
     }
     this.mClient.LoadAchievements((Action <Achievement[]>)(ach =>
     {
         IAchievementDescription[] iachievementDescriptionArray = new IAchievementDescription[ach.Length];
         for (int index = 0; index < iachievementDescriptionArray.Length; ++index)
         {
             iachievementDescriptionArray[index] = (IAchievementDescription) new PlayGamesAchievement(ach[index]);
         }
         callback(iachievementDescriptionArray);
     }));
 }
        /// <summary>
        /// Loads the Achievement descriptions.
        /// <param name="callback">The callback to receive the descriptions</param>
        /// </summary>
        public void LoadAchievementDescriptions(Action <IAchievementDescription[]> callback)
        {
            if (!IsAuthenticated())
            {
                Logger.e("LoadAchievementDescriptions can only be called after authentication.");
                callback.Invoke(null);
            }

            mClient.LoadAchievements(ach =>
            {
                IAchievementDescription[] data = new IAchievementDescription[ach.Length];
                for (int i = 0; i < data.Length; i++)
                {
                    data[i] = new PlayGamesAchievement(ach[i]);
                }

                callback.Invoke(data);
            });
        }
Exemplo n.º 6
0
        /// <summary>
        /// Loads the Achievement descriptions.
        /// <param name="callback">The callback to receive the descriptions</param>
        /// </summary>
        public void LoadAchievementDescriptions(Action<IAchievementDescription[]> callback)
        {
            if (!IsAuthenticated())
            {
                GooglePlayGames.OurUtils.Logger.e("LoadAchievementDescriptions can only be called after authentication.");
                callback.Invoke(null);
            }

            mClient.LoadAchievements(ach =>
                {
                    IAchievementDescription[] data = new IAchievementDescription[ach.Length];
                    for (int i = 0; i < data.Length; i++)
                    {
                        data[i] = new PlayGamesAchievement(ach[i]);
                    }

                    callback.Invoke(data);
                });
        }
 void OnLoadACDesc(IAchievementDescription[] acDesc)
 {
 }
Exemplo n.º 8
0
 private void HandleAchievementDescriptionsLoaded(IAchievementDescription[] achievementDescriptions)
 {
     foreach (IAchievementDescription achievementDescription in achievementDescriptions) {
     }
 }
Exemplo n.º 9
0
 public void OnLoadACDesc(IAchievementDescription[] acDesc)
 {
     Debug.Log("GPGUI: Loaded Achievement Description: " + acDesc.Length);
 }
		internal static iOSAchievementDescription[] ConvertAchievementDescriptionList (IAchievementDescription[] _achievementDescriptionList)
		{
			if (_achievementDescriptionList == null)
				return null;

			int  							_count 							= _achievementDescriptionList.Length;
			iOSAchievementDescription[]		_iOSAchievementDescriptionList	= new iOSAchievementDescription[_count];
			
			for (int _iter = 0; _iter < _count; _iter++)
				_iOSAchievementDescriptionList[_iter] 						= new iOSAchievementDescription(_achievementDescriptionList[_iter]);

			return _iOSAchievementDescriptionList;
		}
		internal iOSAchievementDescription (IAchievementDescription _descriptionData)
		{
			m_achievementDescriptionData	= _descriptionData;
		}
Exemplo n.º 12
0
	/// <summary>
	/// Gets the achievement's icon or a default one.
	/// </summary>
	/// <returns>The achievement's icon.</returns>
	static Texture2D GetIcon (IAchievementDescription description)
	{
		var icon = description.image;

		// Try using a default image, if one's set.
		if (icon == null) {
			icon = LumosSocialGUI.defaultAchIcon;
		}

		return icon;
	}
 /// <summary>
 /// Callback for retrieving achievement descriptions.
 /// </summary>
 /// <param name='descriptions'>
 /// Descriptions.
 /// </param>
 void AchievementDescriptionsCallback(IAchievementDescription [] descriptions)
 {
     // If the received list of descriptions was null, then
     // for the purposes of this sample code, retrieving descriptionss has failed.
     if(null == descriptions) {
         achievementDescriptionStatus = GameCircleSocialExample.AsyncOperationStatus.Failed;
         return;
     }
     achievementDescriptionStatus = GameCircleSocialExample.AsyncOperationStatus.Success;
     achievementDescriptions = descriptions;
 }
Exemplo n.º 14
0
 internal iOSAchievementDescription(IAchievementDescription _descriptionData)
 {
     m_achievementDescriptionData = _descriptionData;
 }