public PPSDemoTagedAchievementView(MNAchievementsProvider.GameAchievementInfo tagedAchInf,string tagetAchImageUrl)
    {
        viewName = "Taget Achievement";

        this.tagedAchInf = tagedAchInf;
        this.tagetAchImageUrl = tagetAchImageUrl;

        MNImageLoader.GetInstance().Load(tagetAchImageUrl, OnImageLoaded);
    }
        public static MNAchievementsProvider.GameAchievementInfo MNAchievementsProviderGameAchievementInfoFromDictionary(IDictionary deserializedObject)
        {
            if (deserializedObject == null) {
            return null;
              }

              MNAchievementsProvider.GameAchievementInfo typedResult = new MNAchievementsProvider.GameAchievementInfo();

              typedResult.Description = (string)deserializedObject["Description"];
              typedResult.Flags = Convert.ToInt32(deserializedObject["Flags"]);
              typedResult.Id = Convert.ToInt32(deserializedObject["Id"]);
              typedResult.Name = (string)deserializedObject["Name"];
              typedResult.Params = (string)deserializedObject["Params"];
              typedResult.Points = Convert.ToInt32(deserializedObject["Points"]);

              return typedResult;
        }
    public override void Draw()
    {
        if (PPSDemoInfoStorage.currentUserInfo != null)
           {
        if (!playerAchArrayUpdated)
        {
          playerAchInfoArray = MNDirect.GetAchievementsProvider().GetPlayerAchievementsList();
          playerAchArrayUpdated= true;
        }

        if(GUILayout.Button("Unlock achievements"))
        {
          PPSDemoMain.stackView.Push(new PPSDemoUnlockAchievementsView());
        }

        if (playerAchArrayUpdated)
        {
          if (playerAchInfoArray != null)
          {
        for (int index = 0;index < playerAchInfoArray.Length;index++)
        {
            if(GUILayout.Button("Achievment Id: "+playerAchInfoArray[index].Id))
            {
              tagedAchInf = MNDirect.GetAchievementsProvider().FindGameAchievementById(playerAchInfoArray[index].Id);
              tagetAchImageUrl = MNDirect.GetAchievementsProvider().GetAchievementImageURL(tagedAchInf.Id);
              PPSDemoMain.stackView.Push(new PPSDemoTagedAchievementView(tagedAchInf,tagetAchImageUrl));
            }
        }
          }
          else
          {
        GUILayout.Label(PPSDemoCommonInfo.noAchievementsMessage);
          }
        }
        else
        {
          GUILayout.Label(PPSDemoCommonInfo.InformationUpdatingMessage);
        }
           }
           else
           {
         GUILayout.Label(PPSDemoCommonInfo.NotLoggedInMessage);
           }
    }
    public override void Draw()
    {
        if (gameAchievementListLoaded)
        {
          if (achInfoArray == null)
          {
        achInfoArray = MNDirect.GetAchievementsProvider().GetGameAchievementsList();
          }

          for (int index = 0;index < achInfoArray.Length;index++)
          {
        if(GUILayout.Button(achInfoArray[index].Name))
        {
          tagedAchInf = achInfoArray[index];
          tagetAchImageUrl = MNDirect.GetAchievementsProvider().GetAchievementImageURL(tagedAchInf.Id);
          PPSDemoMain.stackView.Push(new PPSDemoTagedAchievementView(tagedAchInf,tagetAchImageUrl));
        }
          }
        }
        else
        {
          GUILayout.Label(PPSDemoCommonInfo.InformationUpdatingMessage);
        }
    }
        public MNAchievementsProvider.GameAchievementInfo[] GetGameAchievementsList()
        {
            MNTools.DLog("MNAchievementsProvider:GetGameAchievementsList");

              if (Application.platform == RuntimePlatform.Android) {
            List<object> deserializedArray = MNUnityCommunicator.Serializer.DeserializeArray(
              MNAchievementsProviderUnityClass.CallStatic<string>("getGameAchievementsList"),
              typeof(MNAchievementsProvider.GameAchievementInfo));

            MNAchievementsProvider.GameAchievementInfo[] resultArray = new MNAchievementsProvider.GameAchievementInfo[deserializedArray.Count];

            for (int index = 0;index < deserializedArray.Count;index++) {
              resultArray[index] = (MNAchievementsProvider.GameAchievementInfo)(deserializedArray[index]);
            }

            return resultArray;
              }
              else {
            return new MNAchievementsProvider.GameAchievementInfo[0];
              }
        }