//--------------------------------------
    // EVENTS
    //--------------------------------------

    private void OnLoadSnapshotsResult(string data)
    {
        Debug.Log("SavedGamesManager: OnLoadSnapshotsResult");

        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        if (result.isSuccess)
        {
            _AvailableGameSaves.Clear();

            for (int i = 1; i < storeData.Length; i += 4)
            {
                if (storeData[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }

                GP_SnapshotMeta meta = new GP_SnapshotMeta();
                meta.Title = storeData[i];
                meta.LastModifiedTimestamp = System.Convert.ToInt64(storeData [i + 1]);
                meta.Description           = storeData[i + 2];
                meta.CoverImageUrl         = storeData[i + 3];
                meta.TotalPlayedTime       = System.Convert.ToInt64(storeData[i + 4]);

                _AvailableGameSaves.Add(meta);
            }

            Debug.Log("Loaded: " + _AvailableGameSaves.Count + " Snapshots");
        }

        ActionAvailableGameSavesLoaded(result);
    }
예제 #2
0
    private void OnGamesServerAuthCodeLoaded(string data)
    {
        string[]         raw    = data.Split(new string[] { AndroidNative.DATA_SPLITTER }, StringSplitOptions.None);
        GooglePlayResult result = new GooglePlayResult(raw[0]);

        ActionServerAuthCodeLoaded(result, raw[1]);
    }
    private void OnAchievementsLoaded(CEvent e)
    {
        GooglePlayManager.instance.removeEventListener(GooglePlayManager.ACHIEVEMENTS_LOADED, OnAchievementsLoaded);
        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            foreach (string achievementId in GooglePlayManager.instance.achievements.Keys)
            {
                GPAchievement achievement = GooglePlayManager.instance.GetAchievement(achievementId);
                Debug.Log(achievement.id);
                Debug.Log(achievement.name);
                Debug.Log(achievement.description);
                Debug.Log(achievement.type);
                Debug.Log(achievement.state);
                Debug.Log(achievement.currentSteps);
                Debug.Log(achievement.totalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.instance.achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.instance.achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.message);
        }
    }
예제 #4
0
    private void OnGPQuestsLoaded(string data)
    {
        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        if (result.isSuccess)
        {
            for (int i = 1; i < storeData.Length; i += 9)
            {
                if (storeData[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }

                UpdateQuestInfo(
                    storeData[i],
                    storeData[i + 1],
                    storeData[i + 2],
                    storeData[i + 3],
                    storeData[i + 4],
                    storeData[i + 5],
                    storeData[i + 6],
                    storeData[i + 7],
                    storeData[i + 8]
                    );
            }
        }


        dispatch(QUESTS_LOADED, result);
        OnQuestsLoaded(result);
        Debug.Log("OnGPQuestsLoaded, total:" + _Quests.Count.ToString());
    }
    private void OnAchievementsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
        if (result.IsSucceeded)
        {
            foreach (GPAchievement achievement in GooglePlayManager.Instance.Achievements)
            {
                Debug.Log(achievement.Id);
                Debug.Log(achievement.Name);
                Debug.Log(achievement.Description);
                Debug.Log(achievement.Type);
                Debug.Log(achievement.State);
                Debug.Log(achievement.CurrentSteps);
                Debug.Log(achievement.TotalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.Achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.Achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.Message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.Message);
        }
    }
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
        if (res.IsSucceeded)
        {
            foreach (GP_SnapshotMeta meta in GooglePlaySavedGamesManager.Instance.AvailableGameSaves)
            {
                Debug.Log("Meta.Title: " + meta.Title);
                Debug.Log("Meta.Description: " + meta.Description);
                Debug.Log("Meta.CoverImageUrl): " + meta.CoverImageUrl);
                Debug.Log("Meta.LastModifiedTimestamp: " + meta.LastModifiedTimestamp);
                Debug.Log("Meta.TotalPlayedTime" + meta.TotalPlayedTime);
            }

            if (GooglePlaySavedGamesManager.Instance.AvailableGameSaves.Count > 0)
            {
                GP_SnapshotMeta s      = GooglePlaySavedGamesManager.Instance.AvailableGameSaves[0];
                AndroidDialog   dialog = AndroidDialog.Create("Load Snapshot?", "Would you like to load " + s.Title);
                dialog.ActionComplete += OnSpanshotLoadDialogComplete;
            }
        }
        else
        {
            AndroidMessage.Create("Fail", "Available Game Saves Load failed");
        }
    }
예제 #7
0
	public UM_Result(GooglePlayResult result) {
		_IsSucceeded = result.isSuccess;
		
		if(!_IsSucceeded) {
			_Error =  new UM_Error( (int) result.response, result.message);
		}
	}
예제 #8
0
    private void OnAchievementsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
        if (result.isSuccess)
        {
            foreach (string achievementId in GooglePlayManager.Instance.achievements.Keys)
            {
                GPAchievement achievement = GooglePlayManager.Instance.GetAchievement(achievementId);
                Debug.Log(achievement.id);
                Debug.Log(achievement.name);
                Debug.Log(achievement.description);
                Debug.Log(achievement.type);
                Debug.Log(achievement.state);
                Debug.Log(achievement.currentSteps);
                Debug.Log(achievement.totalSteps);
            }

            SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.achievements.Count.ToString();
            AN_PoupsProxy.showMessage("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.achievements.Count.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Achievments Loaded error: ", result.message);
        }
    }
예제 #9
0
    private void ActionScoreRequestReceived(GooglePlayResult obj)
    {
        SA_StatusBar.text = "Scores Load Finished";

        loadedLeaderBoard = GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID);


        if (loadedLeaderBoard == null)
        {
            Debug.Log("No Leaderboard found");
            return;
        }

        List <GPScore> scoresLB = loadedLeaderBoard.GetScoresList(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL);

        foreach (GPScore score in scoresLB)
        {
            Debug.Log("OnScoreUpdated " + score.rank + " " + score.playerId + " " + score.score);
        }

        GPScore currentPlayerScore = loadedLeaderBoard.GetCurrentPlayerScore(displayTime, displayCollection);

        Debug.Log("currentPlayerScore: " + currentPlayerScore.score + " rank:" + currentPlayerScore.rank);


        UpdateScoresDisaplay();
    }
    private void OnLoadInvitationsResult(string data)
    {
        string[] dataArray = data.Split(new string[] { AndroidNative.DATA_SPLITTER2 }, StringSplitOptions.None);


        List <GP_Invite> Invites = new List <GP_Invite>();

        GooglePlayResult result = new GooglePlayResult(dataArray [0]);

        if (result.IsSucceeded)
        {
            for (int i = 1; i < dataArray.Length; i++)
            {
                if (dataArray[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }

                string[] storeData = dataArray[i].Split(AndroidNative.DATA_SPLITTER [0]);

                GP_Invite invite = InviteFromString(storeData, 0);
                Invites.Add(invite);
            }
        }


        ActionInvitationsListLoaded(Invites);
    }
    private void OnLoadResult(string code)
    {
        GooglePlayResult result = new GooglePlayResult(code);

        ActionGameSaveResult(result);
        dispatch(GAME_SAVE_RESULT, result);
    }
    private void OnLeaderBoardsLoaded(CEvent e)
    {
        GooglePlayManager.instance.removeEventListener(GooglePlayManager.LEADERBOARDS_LOADED, OnLeaderBoardsLoaded);

        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            if (GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID) == null)
            {
                AN_PoupsProxy.showMessage("Leader boards loaded", LEADERBOARD_ID + " not found in leader boards list");
                return;
            }


            SA_StatusBar.text = LEADERBOARD_NAME + "  score  " + GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).score.ToString();
            AN_PoupsProxy.showMessage(LEADERBOARD_NAME + "  score", GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).score.ToString());
        }
        else
        {
            SA_StatusBar.text = result.message;
            AN_PoupsProxy.showMessage("Leader-Boards Loaded error: ", result.message);
        }

        UpdateBoardInfo();
    }
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
        if (res.IsSucceeded)
        {
            try
            {
                foreach (GP_SnapshotMeta meta in GooglePlaySavedGamesManager.Instance.AvailableGameSaves)
                {
                    Debug.Log("Meta.Title: " + meta.Title);
                    Debug.Log("Meta.Description: " + meta.Description);
                    Debug.Log("Meta.CoverImageUrl): " + meta.CoverImageUrl);
                    Debug.Log("Meta.LastModifiedTimestamp: " + meta.LastModifiedTimestamp);
                    Debug.Log("Meta.TotalPlayedTime" + meta.TotalPlayedTime);
                }

                if (GooglePlaySavedGamesManager.Instance.AvailableGameSaves.Count > 0)
                {
                    GP_SnapshotMeta s = GooglePlaySavedGamesManager.Instance.AvailableGameSaves[0];
                    GooglePlaySavedGamesManager.Instance.LoadSpanshotByName(s.Title);
                }
            }
            catch (Exception e)
            {
                Debug.Log("ActionAvailableGameSavesLoaded Exception: " + e.Message);
                AndroidNativeUtility.HidePreloader();
            }
        }
        else
        {
            AndroidNativeUtility.HidePreloader();
            AndroidMessage.Create("\nGame\n", "Failed to load game data from Cloud in Internet.\n\nPlease, check your Internet connection and try again.");
        }
    }
예제 #14
0
    private void OnPlayersLoaded(string data)
    {
        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        if (result.IsSucceeded)
        {
            for (int i = 1; i < storeData.Length; i += 6)
            {
                if (storeData[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }


                GooglePlayerTemplate p = new GooglePlayerTemplate(storeData[i], storeData[i + 1], storeData[i + 2], storeData[i + 3], storeData[i + 4], storeData[i + 5]);
                AddPlayer(p);
                if (!_friendsList.Contains(p.playerId))
                {
                    _friendsList.Add(p.playerId);
                }
            }
        }



        Debug.Log("OnPlayersLoaded, total:" + players.Count.ToString());
        ActionFriendsListLoaded(result);
    }
 private void OnGooglePlayServiceDataLoaded(GooglePlayResult result)
 {
     _CurrentEventsCount++;
     if (_CurrentEventsCount == _DataEventsCount)
     {
         OnAllLoaded();
     }
 }
예제 #16
0
    public UM_Result(GooglePlayResult result)
    {
        _IsSucceeded = result.IsSucceeded;

        if (!_IsSucceeded)
        {
            _Error = new UM_Error((int)result.Response, result.Message);
        }
    }
예제 #17
0
    private void OnScoreSubmited(CEvent e)
    {
        GooglePlayResult result = e.data as GooglePlayResult;

        SA_StatusBar.text = "Score Submit Resul:  " + result.message;

        //Reloading scores list:
        GooglePlayManager.instance.LoadTopScores(LEADERBOARD_ID, GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL, 10);
        GooglePlayManager.instance.LoadTopScores(LEADERBOARD_ID, GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS, 10);
    }
예제 #18
0
    private void OnAchievementUpdated(string data)
    {
        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        result.achievementId = storeData [1];

        dispatch(ACHIEVEMENT_UPDATED, result);
    }
 private void OnGooglePlayServiceDataLoaded(GooglePlayResult result)
 {
     if (result.isSuccess)
     {
         currentEventsCount++;
         if (currentEventsCount == dataEventsCount)
         {
             OnAllLoaded();
         }
     }
 }
    private void OnQuestsLoaded(GooglePlayResult result)
    {
        Debug.Log("Total Quests: " + GooglePlayQuests.Instance.GetQuests().Count);
        AN_PoupsProxy.showMessage("Quests Loaded", "Total Quests: " + GooglePlayQuests.Instance.GetQuests().Count);

        SA_StatusBar.text = "OnQuestsLoaded:  " + result.Response.ToString();

        foreach (GP_Quest quest in GooglePlayQuests.Instance.GetQuests())
        {
            Debug.Log(quest.Id);
        }
    }
예제 #21
0
 private void ActionScoreRequestReceived(GooglePlayResult obj)
 {
     if (obj.IsSucceeded && !obj.IsFailed)
     {
         isLoadingSuccessed = true;
     }
     else
     {
         isLoadingSuccessed = false;
     }
     isLoading = false;
 }
예제 #22
0
    private void OnPlayerInfoLoaded(CEvent e)
    {
        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            playerLabel = GooglePlayManager.instance.player.name;
        }
        else
        {
            playerLabel = "error: " + result.message;
        }
    }
    void OnGooglePlayLeaderDataLoaded(GooglePlayResult res)
    {
        foreach (GPLeaderBoard lb in GooglePlayManager.Instance.LeaderBoards)
        {
            UM_Leaderboard leaderboard = UltimateMobileSettings.Instance.GetLeaderboardByAndroidId(lb.Id);
            if (leaderboard != null)
            {
                leaderboard.Setup(lb);
            }
        }

        OnGooglePlayServiceDataLoaded(res);
    }
예제 #24
0
    private void ActionGameSaveResult(GooglePlayResult result)
    {
        GooglePlaySavedGmaesManager.ActionGameSaveResult -= ActionGameSaveResult;
        Debug.Log("ActionGameSaveResult: " + result.message);

        if (result.isSuccess)
        {
            SA_StatusBar.text = "Games Saved.";
        }
        else
        {
            SA_StatusBar.text = "Games Save Failed";
        }
    }
예제 #25
0
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void OnAchivmentsLoaded(CEvent e)
    {
        GooglePlayManager.instance.removeEventListener(GooglePlayManager.ACHIEVEMENTS_LOADED, OnAchivmentsLoaded);
        GooglePlayResult result = e.data as GooglePlayResult;

        if (result.isSuccess)
        {
            AndroidNative.showMessage("OnAchivmentsLoaded", "Total Achivments: " + GooglePlayManager.instance.achievements.Count.ToString());
        }
        else
        {
            AndroidNative.showMessage("OnAchivmentsLoaded error: ", result.message);
        }
    }
    private void OnLeaderboardDataLoaded(string data)
    {
        Debug.Log("OnLeaderboardDataLoaded " + data);
        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);


        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        if (result.IsSucceeded)
        {
            for (int i = 1; i < storeData.Length; i += 32)
            {
                if (storeData[i] == AndroidNative.DATA_EOF)
                {
                    break;
                }

                string leaderboardId   = storeData[i];
                string leaderboardName = storeData [i + 1];

                GPLeaderBoard lb = GetLeaderBoard(leaderboardId);
                lb.UpdateName(leaderboardName);

                int start = i + 2;
                for (int j = 0; j < 6; j++)
                {
                    long score = System.Convert.ToInt64(storeData[start]);
                    int  rank  = System.Convert.ToInt32(storeData[start + 1]);

                    GPBoardTimeSpan  timeSpan   = (GPBoardTimeSpan)System.Convert.ToInt32(storeData[start + 2]);
                    GPCollectionType collection = (GPCollectionType)System.Convert.ToInt32(storeData[start + 3]);
                    string           tag        = storeData[start + 4];

                    //Debug.Log("timeSpan: " + timeSpan +   " collection: " + collection + " score:" + score + " rank:" + rank);

                    GPScore s = new GPScore(score, rank, timeSpan, collection, lb.Id, player.playerId, tag);
                    start = start + 5;
                    lb.UpdateScore(s);
                    lb.UpdateCurrentPlayerScore(s);
                }
            }

            Debug.Log("Loaded: " + LeaderBoards.Count + " Leaderboards");
        }

        _IsLeaderboardsDataLoaded = true;
        ActionLeaderboardsLoaded(result);
    }
예제 #27
0
    private void OnLeaderBoardsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionLeaderboardsLoaded -= OnLeaderBoardsLoaded;
        if(result.isSuccess)
        {
            if( GooglePlayManager.instance.GetLeaderBoard("CgkImaKMrMQBEAIQCA") == null)
            {

            }
        }
        else
        {

        }
    }
    //--------------------------------------
    // EVENTS
    //--------------------------------------

    private void OnEventsLoaded(GooglePlayResult result)
    {
        Debug.Log("Total Events: " + GooglePlayEvents.Instance.Events.Count);
        AN_PoupsProxy.showMessage("Events Loaded", "Total Events: " + GooglePlayEvents.Instance.Events.Count);
        SA_StatusBar.text = "OnEventsLoaded:  " + result.Response.ToString();

        foreach (GP_Event ev in GooglePlayEvents.Instance.Events)
        {
            Debug.Log(ev.Id);
            Debug.Log(ev.Description);
            Debug.Log(ev.FormattedValue);
            Debug.Log(ev.Value);
            Debug.Log(ev.IconImageUrl);
            Debug.Log(ev.icon);
        }
    }
    private void OnAchievmnetsLoadedInfoListner(GooglePlayResult res)
    {
        GPAchievement achievement = GooglePlayManager.Instance.GetAchievement(INCREMENTAL_ACHIEVEMENT_ID);


        if (achievement != null)
        {
            a_id.text    = "Id: " + achievement.Id;
            a_name.text  = "Name: " + achievement.Name;
            a_descr.text = "Description: " + achievement.Description;
            a_type.text  = "Type: " + achievement.Type.ToString();
            a_state.text = "State: " + achievement.State.ToString();
            a_steps.text = "CurrentSteps: " + achievement.CurrentSteps.ToString();
            a_total.text = "TotalSteps: " + achievement.TotalSteps.ToString();
        }
    }
예제 #30
0
    private void OnScoreSubmitted(string data)
    {
        if (data.Equals(string.Empty))
        {
            Debug.Log("GooglePlayManager OnScoreSubmitted, no data avaiable");
            return;
        }

        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        result.leaderboardId = storeData [1];

        dispatch(SCORE_SUBMITED, result);
    }
 void OnFriendListLoaded(GooglePlayResult result)
 {
     /*Debug.Log("OnFriendListLoaded: " + result.Message);
      * GooglePlayManager.ActionFriendsListLoaded -=  OnFriendListLoaded;
      *
      * if(result.IsSucceeded) {
      *      Debug.Log("Friends Load Success");
      *
      *      int i = 0;
      *      foreach(string fId in GooglePlayManager.instance.friendsList) {
      *              if(i < 3) {
      *                      friends[i].SetFriendId(fId);
      *              }
      *              i++;
      *      }
      * }*/
 }
예제 #32
0
    private void OnPlayerLoaded(string data)
    {
        if (data.Equals(string.Empty))
        {
            Debug.Log("GooglePlayManager OnPlayerLoaded, no data avaiable");
            return;
        }

        string[] storeData;
        storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        GooglePlayResult result = new GooglePlayResult(storeData [0]);

        _player = new GooglePlayerTemplate(storeData [1], storeData [2]);

        dispatch(PLAYER_LOADED, result);
        Debug.Log("GooglePlayManager -> PLAYER_LOADED");
    }
예제 #33
0
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded += ActionAvailableGameSavesLoaded;
        if(res.isSuccess) {
            foreach(GP_SnapshotMeta meta in GooglePlaySavedGamesManager.instance.AvailableGameSaves) {
                Debug.Log("Meta.Title: " 					+ meta.Title);
                Debug.Log("Meta.Description: " 				+ meta.Description);
                Debug.Log("Meta.CoverImageUrl): " 			+ meta.CoverImageUrl);
                Debug.Log("Meta.LastModifiedTimestamp: " 	+ meta.LastModifiedTimestamp);

            }

            if(GooglePlaySavedGamesManager.instance.AvailableGameSaves.Count > 0) {
                GP_SnapshotMeta s =  GooglePlaySavedGamesManager.instance.AvailableGameSaves[0];
                AndroidDialog dialog = AndroidDialog.Create("Load Snapshot?", "Would you like to load " + s.Title);
                dialog.OnComplete += OnSpanshotLoadDialogComplete;
            }

        } else {
            AndroidMessage.Create("Fail", "Available Game Saves Load failed");
        }
    }
예제 #34
0
    private void OnAchievmentsLoaded(GooglePlayResult result)
    {
        GooglePlayManager.ActionAchievementsLoaded -=  OnAchievmentsLoaded;
        if(result.isSuccess)
        {
            foreach(string achievementId in GooglePlayManager.instance.achievements.Keys)
            {
                GPAchievement achievement = GooglePlayManager.instance.GetAchievement(achievementId);
                Debug.Log(achievement.id);
                Debug.Log(achievement.name);
                Debug.Log(achievement.description);
                Debug.Log(achievement.type);
                Debug.Log(achievement.state);
                Debug.Log(achievement.currentSteps);
                Debug.Log(achievement.totalSteps);
            }
        }
        else
        {

        }
    }
예제 #35
0
    private void ActionScoreRequestReceived(GooglePlayResult obj)
    {
        SA_StatusBar.text = "Scores Load Finished";

        loadedLeaderBoard = GooglePlayManager.instance.GetLeaderBoard(LEADERBOARD_ID);

        if(loadedLeaderBoard == null) {
            Debug.Log("No Leaderboard found");
            return;
        }

        List<GPScore> scoresLB =  loadedLeaderBoard.GetScoresList(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL);

        foreach(GPScore score in scoresLB) {
            Debug.Log("OnScoreUpdated " + score.rank + " " + score.playerId + " " + score.score);
        }

        GPScore currentPlayerScore = loadedLeaderBoard.GetCurrentPlayerScore(displayTime, displayCollection);

        Debug.Log("currentPlayerScore: " + currentPlayerScore.score + " rank:" + currentPlayerScore.rank);

        UpdateScoresDisaplay();
    }
예제 #36
0
	private void OnScoreSubmited(GooglePlayResult result) {
		SA_StatusBar.text = "Score Submited:  " + result.message;
	}
예제 #37
0
	public UM_LeaderboardResult(UM_Leaderboard leaderboard, GooglePlayResult result):base(result) {
		Setinfo(leaderboard);
	}
예제 #38
0
 //--------------------------------------
 // EVENTS
 //--------------------------------------
 private void OnEventsLoaded(GooglePlayResult result)
 {
     AndroidNative.showMessage ("Events Loaded", "Total Events: " + GooglePlayEvents.instance.Events.Count);
     SA_StatusBar.text = "OnEventsLoaded:  " + result.response.ToString();
 }
예제 #39
0
	void OnFriendListLoaded (GooglePlayResult result) {
		Debug.Log("OnFriendListLoaded: " + result.message);
		GooglePlayManager.ActionFriendsListLoaded -=  OnFriendListLoaded;

		if(result.isSuccess) {
			Debug.Log("Friends Load Success");

			int i = 0;
			foreach(string fId in GooglePlayManager.instance.friendsList) {
				if(i < 3) {
					friends[i].SetFriendId(fId);
				}
				i++;
			}
		}
	}
예제 #40
0
	private void OnAchievementsLoaded(GooglePlayResult result) {
		GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
		if(result.isSuccess) {

			foreach (GPAchievement achievement in GooglePlayManager.Instance.Achievements) {
				Debug.Log(achievement.Id);
				Debug.Log(achievement.Name);
				Debug.Log(achievement.Description);
				Debug.Log(achievement.Type);
				Debug.Log(achievement.State);
				Debug.Log(achievement.CurrentSteps);
				Debug.Log(achievement.TotalSteps);
			}

			SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.Achievements.Count.ToString();
			AN_PoupsProxy.showMessage ("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.Achievements.Count.ToString());
		} else {
			SA_StatusBar.text = result.message;
			AN_PoupsProxy.showMessage ("Achievments Loaded error: ", result.message);
		}

	}
	private void OnQuestsLoaded (GooglePlayResult result) {
		Debug.Log ("Total Quests: " + GooglePlayQuests.instance.GetQuests().Count);
		AN_PoupsProxy.showMessage ("Quests Loaded", "Total Quests: " + GooglePlayQuests.instance.GetQuests().Count);

		SA_StatusBar.text = "OnQuestsLoaded:  " + result.Response.ToString();

		foreach(GP_Quest quest in GooglePlayQuests.instance.GetQuests()) {
			Debug.Log(quest.Id);
		}
	}
	//--------------------------------------
	// EVENTS
	//--------------------------------------

	private void OnEventsLoaded (GooglePlayResult result) {
		Debug.Log ("Total Events: " + GooglePlayEvents.instance.Events.Count);
		AN_PoupsProxy.showMessage ("Events Loaded", "Total Events: " + GooglePlayEvents.instance.Events.Count);
		SA_StatusBar.text = "OnEventsLoaded:  " + result.Response.ToString();

		foreach(GP_Event ev in GooglePlayEvents.instance.Events) {
			Debug.Log(ev.Id);
			Debug.Log(ev.Description);
			Debug.Log(ev.FormattedValue);
			Debug.Log(ev.Value);
			Debug.Log(ev.IconImageUrl);
			Debug.Log(ev.icon);
		}
	}
	private void OnFriendListLoaded(GooglePlayResult result) {
		GooglePlayManager.ActionFriendsListLoaded -=  OnFriendListLoaded;
		SA_StatusBar.text = "Load Friends Result:  " + result.response.ToString();
	}
	private void OnQuestsLoaded (GooglePlayResult result) {
		Debug.Log ("Total Quests: " + GooglePlayQuests.instance.GetQuests().Count);
		AndroidNative.showMessage ("Quests Loaded", "Total Quests: " + GooglePlayQuests.instance.GetQuests().Count);

		SA_StatusBar.text = "OnQuestsLoaded:  " + result.response.ToString();
	}
예제 #45
0
	private void OnAchievmnetsLoadedInfoListner(GooglePlayResult res) {
		GPAchievement achievement = GooglePlayManager.Instance.GetAchievement(INCREMENTAL_ACHIEVEMENT_ID);


		if(achievement != null) {
			a_id.text 		= "Id: " + achievement.Id;
			a_name.text 	= "Name: " +achievement.Name;
			a_descr.text 	= "Description: " + achievement.Description;
			a_type.text 	= "Type: " + achievement.Type.ToString();
			a_state.text 	= "State: " + achievement.State.ToString();
			a_steps.text 	= "CurrentSteps: " + achievement.CurrentSteps.ToString();
			a_total.text 	= "TotalSteps: " + achievement.TotalSteps.ToString();
		}
	}
예제 #46
0
	private void OnAchievementsLoaded(GooglePlayResult result) {
		GooglePlayManager.ActionAchievementsLoaded -= OnAchievementsLoaded;
		if(result.isSuccess) {

			foreach(string achievementId in GooglePlayManager.Instance.achievements.Keys) {
				GPAchievement achievement = GooglePlayManager.Instance.GetAchievement(achievementId);
				Debug.Log(achievement.id);
				Debug.Log(achievement.name);
				Debug.Log(achievement.description);
				Debug.Log(achievement.type);
				Debug.Log(achievement.state);
				Debug.Log(achievement.currentSteps);
				Debug.Log(achievement.totalSteps);
			}

			SA_StatusBar.text = "Total Achievement: " + GooglePlayManager.Instance.achievements.Count.ToString();
			AN_PoupsProxy.showMessage ("Achievments Loaded", "Total Achievements: " + GooglePlayManager.Instance.achievements.Count.ToString());
		} else {
			SA_StatusBar.text = result.message;
			AN_PoupsProxy.showMessage ("Achievments Loaded error: ", result.message);
		}

	}
예제 #47
0
	private void OnScoreUpdated(GooglePlayResult res) {
		UpdateBoardInfo();
	}
예제 #48
0
	private void OnLeaderBoardsLoaded(GooglePlayResult result) {
		GooglePlayManager.ActionLeaderboardsLoaded -= OnLeaderBoardsLoaded;

		if(result.isSuccess) {
			if( GooglePlayManager.Instance.GetLeaderBoard(LEADERBOARD_ID) == null) {
				AN_PoupsProxy.showMessage("Leader boards loaded", LEADERBOARD_ID + " not found in leader boards list");
				return;
			}


			SA_StatusBar.text = LEADERBOARD_NAME + "  score  " + GooglePlayManager.Instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).LongScore.ToString();
			AN_PoupsProxy.showMessage (LEADERBOARD_NAME + "  score",  GooglePlayManager.Instance.GetLeaderBoard(LEADERBOARD_ID).GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.FRIENDS).LongScore.ToString());
		} else {
			SA_StatusBar.text = result.message;
			AN_PoupsProxy.showMessage ("Leader-Boards Loaded error: ", result.message);
		}

		UpdateBoardInfo();

	}