//--------------------------------------
    // PUBLIC API CALL METHODS
    //--------------------------------------



    private void Init()
    {
        string connectionString = "";

        if (AndroidNativeSettings.Instance.EnableGamesAPI)
        {
            connectionString += "GamesAPI";
        }

        if (AndroidNativeSettings.Instance.EnableAppStateAPI)
        {
            connectionString += "AppStateAPI";
        }

        if (AndroidNativeSettings.Instance.EnablePlusAPI)
        {
            connectionString += "PlusAPI";
        }

        if (AndroidNativeSettings.Instance.EnableDriveAPI)
        {
            connectionString += "DriveAPI";
        }

        AN_GMSGeneralProxy.setConnectionParams(AndroidNativeSettings.Instance.ShowConnectingPopup);
        AN_GMSGeneralProxy.playServiceInit(connectionString);
    }
Ejemplo n.º 2
0
    //--------------------------------------
    // PUBLIC API CALL METHODS
    //--------------------------------------

    private void init()
    {
        string connectionString = "";

        if (AndroidNativeSettings.Instance.EnableGamesAPI)
        {
            connectionString += "GamesAPI";
        }

        if (AndroidNativeSettings.Instance.EnableAppStateAPI)
        {
            connectionString += "AppStateAPI";
        }

        if (AndroidNativeSettings.Instance.EnablePlusAPI)
        {
            connectionString += "PlusAPI";
        }

        if (AndroidNativeSettings.Instance.EnableDriveAPI)
        {
            connectionString += "DriveAPI";
        }

        AN_GMSGeneralProxy.playServiceInit(connectionString);

        _isInitialized = true;
    }
Ejemplo n.º 3
0
 public void UpdatePlayerScore(string leaderboardId, GPBoardTimeSpan span, GPCollectionType collection)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.UpdatePlayerScore(leaderboardId, (int)span, (int)collection);
 }
Ejemplo n.º 4
0
 public void ShowAchievementsUI()
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.showAchievementsUI();
 }
Ejemplo n.º 5
0
 public void revealAchievement(string achievementName)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.revealAchievement(achievementName);
 }
Ejemplo n.º 6
0
 public void ShowLeaderBoardsUI()
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.showLeaderBoardsUI();
 }
Ejemplo n.º 7
0
 public void UnlockAchievementById(string achievementId)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.reportAchievementById(achievementId);
 }
Ejemplo n.º 8
0
 public void LoadLeaderBoards()
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.loadLeaderBoards();
 }
Ejemplo n.º 9
0
 public void LoadTopScores(string leaderboardId, GPBoardTimeSpan span, GPCollectionType collection, int maxResults)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.loadTopScores(leaderboardId, (int)span, (int)collection, maxResults);
 }
Ejemplo n.º 10
0
 public void SetStepsImmediate(string achievementId, int numsteps)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.setStepsImmediate(achievementId, numsteps.ToString());
 }
Ejemplo n.º 11
0
 public void IncrementAchievementById(string achievementId, int numsteps)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.incrementAchievementById(achievementId, numsteps.ToString());
 }
Ejemplo n.º 12
0
 public void ResetAchievement(string achievementId)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.resetAchievement(achievementId);
 }
Ejemplo n.º 13
0
 public void ResetAllAchievements()
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.ResetAllAchievements();
 }
Ejemplo n.º 14
0
 public void LoadFriends()
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.loadConnectedPlayers();
 }
Ejemplo n.º 15
0
 public void SubmitScoreById(string leaderboardId, long score)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.submitScoreById(leaderboardId, score);
 }
Ejemplo n.º 16
0
 public void ShowLeaderBoardById(string leaderboardId)
 {
     if (!GooglePlayConnection.CheckState())
     {
         return;
     }
     AN_GMSGeneralProxy.showLeaderBoardById(leaderboardId);
 }
    //--------------------------------------
    // PUBLIC API CALL METHODS
    //--------------------------------------

    public void ShowSavedGamesUI(string title, int maxNumberOfSavedGamesToShow, bool allowAddButton = true, bool allowDelete = true)
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }

        AN_GMSGeneralProxy.ShowSavedGamesUI_Bridge(title, maxNumberOfSavedGamesToShow, allowAddButton, allowDelete);
    }
Ejemplo n.º 18
0
    //--------------------------------------
    // PUBLIC API CALL METHODS
    //--------------------------------------

    public void ShowSavedGamesUI(string title, int maxNumberOfSavedGamesToShow)
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }

        AN_GMSGeneralProxy.ShowSavedGamesUI_Bridge(title, maxNumberOfSavedGamesToShow);
    }
Ejemplo n.º 19
0
    public void clearDefaultAccount()
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }

        AN_GMSGeneralProxy.clearDefaultAccount();
        GooglePlayConnection.instance.disconnect();
    }
    public void Disconnect()
    {
        if (_State == GPConnectionState.STATE_DISCONNECTED || _State == GPConnectionState.STATE_CONNECTING)
        {
            return;
        }

        OnStateChange(GPConnectionState.STATE_DISCONNECTED);
        AN_GMSGeneralProxy.playServiceDisconnect();
    }
    public void SignOut()
    {
        if (_State == GPConnectionState.STATE_DISCONNECTED || _State == GPConnectionState.STATE_CONNECTING)
        {
            return;
        }

        OnStateChange(GPConnectionState.STATE_DISCONNECTED);
        AN_GMSGeneralProxy.signOut();
    }
Ejemplo n.º 22
0
 public void Resolve(GP_Snapshot snapshot)
 {
     if (snapshot.Equals(_s1))
     {
         AN_GMSGeneralProxy.ResolveSnapshotsConflict_Bridge(0);
     }
     else
     {
         AN_GMSGeneralProxy.ResolveSnapshotsConflict_Bridge(1);
     }
 }
Ejemplo n.º 23
0
    public void UpdatePlayerScoreLocal(GPLeaderBoard leaderboard)
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        int requestId = SA_IdFactory.NextId;

        leaderboard.CreateScoreListener(requestId);

        AN_GMSGeneralProxy.loadLeaderboardInfoLocal(leaderboard.Id, requestId);
    }
Ejemplo n.º 24
0
    public void SubmitScoreById(string leaderboardId, long score)
    {
        if (AndroidNativeSettings.Instance.Is_Leaderboards_Editor_Notifications_Enabled)
        {
            SA_EditorNotifications.ShowNotification(leaderboardId, score + " Scores Submitted", SA_EditorNotificationType.Achievement);
        }

        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.submitScoreById(leaderboardId, score);
    }
Ejemplo n.º 25
0
    public void RevealAchievementById(string achievementId)
    {
        if (AndroidNativeSettings.Instance.Is_Achievements_Editor_Notifications_Enabled)
        {
            SA_EditorNotifications.ShowNotification(achievementId, "Reveal Method Called", SA_EditorNotificationType.Achievement);
        }

        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.revealAchievementById(achievementId);
    }
Ejemplo n.º 26
0
    public void IncrementAchievementById(string achievementId, int numsteps)
    {
        if (AndroidNativeSettings.Instance.Is_Achievements_Editor_Notifications_Enabled)
        {
            SA_EditorNotifications.ShowNotification(achievementId, "Incremented " + numsteps + " Steps", SA_EditorNotificationType.Achievement);
        }

        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.incrementAchievementById(achievementId, numsteps.ToString());
    }
Ejemplo n.º 27
0
    public void ResetLeaderBoard(string leaderboardId)
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.resetLeaderBoard(leaderboardId);

        if (leaderBoards.ContainsKey(leaderboardId))
        {
            leaderBoards.Remove(leaderboardId);
        }
    }
Ejemplo n.º 28
0
    public void UnlockAchievement(string achievementName)
    {
        if (AndroidNativeSettings.Instance.Is_Achievements_Editor_Notifications_Enabled)
        {
            SA_EditorNotifications.ShowNotification(achievementName, "Unlock Method Called", SA_EditorNotificationType.Achievement);
        }

        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.reportAchievement(achievementName);
    }
Ejemplo n.º 29
0
    public void ResetLeaderBoard(string leaderboardId)
    {
        if (!GooglePlayConnection.CheckState())
        {
            return;
        }
        AN_GMSGeneralProxy.resetLeaderBoard(leaderboardId);

        foreach (GPLeaderBoard lb in LeaderBoards)
        {
            if (lb.Id.Equals(leaderboardId))
            {
                LeaderBoards.Remove(lb);
                return;
            }
        }
    }
    public void resolveState(int stateKey, byte[] resolvedData, string resolvedVersion)
    {
        string b   = "";
        int    len = resolvedData.Length;

        for (int i = 0; i < len; i++)
        {
            if (i != 0)
            {
                b += ",";
            }

            b += resolvedData[i].ToString();
        }

        AN_GMSGeneralProxy.ResolveState(stateKey, b, resolvedVersion);
    }