コード例 #1
0
    /// <summary>
    /// gets the root game datamap
    /// </summary>
    /// <returns>Game datamap</returns>
    public static AGSGameDataMap GetGameData( )
    {
        AndroidJavaObject jo = javaObject.Call <AndroidJavaObject>("getGameData");

        if (jo != null)
        {
            return(new AGSGameDataMap(jo));
        }
        return(null);
    }
コード例 #2
0
    /// <summary>
    /// Gets the AGS syncable.
    /// </summary>
    /// <returns>
    /// The AGS syncable.
    /// </returns>
    /// <param name='method'>
    /// Method.
    /// </param>
    /// <param name='key'>
    /// Key.
    /// </param>
    /// <typeparam name='T'>
    /// The 1st type parameter.
    /// </typeparam>
    protected T GetAGSSyncable <T>(string method, string key)
    {
        AndroidJavaObject jo;

        if (key != null)
        {
            jo = javaObject.Call <AndroidJavaObject>(method, key);
        }
        else
        {
            jo = javaObject.Call <AndroidJavaObject>(method);
        }
        if (jo != null)
        {
            return((T)Activator.CreateInstance(typeof(T), new object[] { jo }));
        }
        //return null or 0 as appropriate to the data type returned
        return(default(T));
    }
コード例 #3
0
 /// <summary>
 /// Initializes this AGSClient.  The serviceReadyEvent or the serviceNotReady event will be called
 /// upon completion
 /// </summary>
 /// <param name="supportsLeaderboards">bool indicating if this game uses leaderboards</param>
 /// <param name="supportsAchievements">bool indicating if this game uses achievements</param>
 /// <param name="supportsWhispersync">bool indicating if this game uses whispersync</param>
 public static void Init(bool supportsLeaderboards, bool supportsAchievements, bool supportsWhispersync)
 {
     JavaObject.Call("init", supportsLeaderboards, supportsAchievements, supportsWhispersync);
 }
コード例 #4
0
 /// <summary>
 /// Request the local player profile information
 /// </summary>
 public static void RequestLocalPlayerProfile()
 {
     JavaObject.Call("requestLocalPlayerProfile");
 }
コード例 #5
0
 /// <summary>
 /// updates an achievement
 /// </summary>
 /// <remarks>
 /// If a value outside of range is submitted, it is capped at 100 or 0.
 /// If submitted value is less than the stored value, the update is ignored.
 /// </remarks>
 /// <param name="achievementId">the id of the achievement to update</param>
 /// <param name="percentComplete">a float between 0.0f and 100.0f</param>
 public static void UpdateAchievementProgress(string achievementId, float progress)
 {
     JavaObject.Call("updateAchievementProgress", achievementId, progress);
 }
コード例 #6
0
 /// <summary>
 /// submit a score to leaderboard
 /// </summary>
 /// <remarks>
 /// SubmitScoreSuccess or SubmitScoreFailure events will be called if they are registered
 /// </remarks>
 /// <param name="leaderboardId">the id of the leaderboard for the score request</param>
 /// <param name="score">player score</param>
 public static void SubmitScore(string leaderboardId, long score)
 {
     JavaObject.Call("submitScore", leaderboardId, score);
 }