示例#1
0
        public ReignScores_ScorePlugin(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
        {
            this.desc = desc;
                        #if UNITY_EDITOR
            gameID = desc.Editor_ReignScores_GameID;
                        #elif UNITY_STANDALONE_WIN
            gameID = desc.Win32_ReignScores_GameID;
                        #elif UNITY_STANDALONE_OSX
            gameID = desc.OSX_ReignScores_GameID;
                        #elif UNITY_STANDALONE_LINUX
            gameID = desc.Linux_ReignScores_GameID;
                        #elif UNITY_WEBPLAYER
            gameID = desc.Web_ReignScores_GameID;
                        #elif UNITY_WP8
            gameID = desc.WP8_ReignScores_GameID;
                        #elif UNITY_METRO
            gameID = desc.WinRT_ReignScores_GameID;
                        #elif UNITY_BLACKBERRY
            gameID = desc.BB10_ReignScores_GameID;
                        #elif UNITY_IPHONE
            gameID = desc.iOS_ReignScores_GameID;
                        #elif UNITY_ANDROID
            gameID = desc.Android_ReignScores_GameID;
                        #endif

            ui = desc.ReignScores_UI;
            ui.Init(this);
            helper = new ReignScores_ServicesHelper(desc);

            if (callback != null)
            {
                callback(true, null);
            }
        }
        public GameCenter_ScorePlugin_iOS(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
        {
                        #if !IOS_DISABLE_APPLE_SCORES
            this.desc = desc;

            try
            {
                InitGameCenter();
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
                if (callback != null)
                {
                    callback(false, e.Message);
                }
                return;
            }

            if (callback != null)
            {
                callback(true, null);
            }
                        #endif
        }
 /// <summary>
 /// Use to init a score API.
 /// </summary>
 /// <param name="desc">Score Desc.</param>
 public static void Init(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
 {
     ScoreManager.createdCallback = callback;
     ReignServices.CheckStatus();
     plugin            = ScorePluginAPI.New(desc, async_CreatedCallback);
     ScoreManager.desc = desc;
     ReignServices.AddService(update, null, null);
 }
		/// <summary>
		/// Use to init a score API.
		/// </summary>
		/// <param name="desc">Score Desc.</param>
		public static void Init(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
		{
			ScoreManager.createdCallback = callback;
			ReignServices.CheckStatus();
			plugin = ScorePluginAPI.New(desc, async_CreatedCallback);
			ScoreManager.desc = desc;
			ReignServices.AddService(update, null, null);
		}
 /// <summary>
 /// Dumy constructor.
 /// </summary>
 /// <param name="desc">Score desc.</param>
 public Dumy_ScorePluginPlugin(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
 {
     IsAuthenticated = false;
     Username        = "******";
     if (callback != null)
     {
         callback(false, "Dumy Score object");
     }
 }
		public GooglePlay_ScorePlugin_Android (ScoreDesc desc, CreatedScoreAPICallbackMethod createdCallback)
		{
			this.desc = desc;
			this.createdCallback = createdCallback;
			try
			{
				native = new AndroidJavaClass("com.reignstudios.reignnative.GooglePlay_LeaderboardsAchievements");
				native.CallStatic("Init", desc.Android_GooglePlay_DisableUsernameRetrieval);
			}
			catch (Exception e)
			{
				Debug.LogError(e.Message);
				if (createdCallback != null) createdCallback(false, e.Message);
			}
		}
		public Amazon_GameCircle_ScorePlugin_Android(ScoreDesc desc, CreatedScoreAPICallbackMethod createdCallback)
		{
			this.desc = desc;
			try
			{
				native = new AndroidJavaClass("com.reignstudios.reignnativeamazon.Amazon_GameCircle_LeaderboardsAchievements");
				native.CallStatic("Init");
			}
			catch (Exception e)
			{
				Debug.LogError(e.Message);
				if (createdCallback != null) createdCallback(false, e.Message);
				return;
			}

			if (createdCallback != null) createdCallback(true, null);
		}
 public GooglePlay_ScorePlugin_Android(ScoreDesc desc, CreatedScoreAPICallbackMethod createdCallback)
 {
     this.desc            = desc;
     this.createdCallback = createdCallback;
     try
     {
         native = new AndroidJavaClass("com.reignstudios.reignnative.GooglePlay_LeaderboardsAchievements");
         native.CallStatic("Init", desc.Android_GooglePlay_DisableUsernameRetrieval);
     }
     catch (Exception e)
     {
         Debug.LogError(e.Message);
         if (createdCallback != null)
         {
             createdCallback(false, e.Message);
         }
     }
 }
        public Amazon_GameCircle_ScorePlugin_Android(ScoreDesc desc, CreatedScoreAPICallbackMethod createdCallback)
        {
            this.desc = desc;
            try
            {
                native = new AndroidJavaClass("com.reignstudios.reignnative.Amazon_GameCircle_LeaderboardsAchievements");
                native.CallStatic("Init");
            }
            catch (Exception e)
            {
                Debug.LogError(e.Message);
                if (createdCallback != null)
                {
                    createdCallback(false, e.Message);
                }
                return;
            }

            if (createdCallback != null)
            {
                createdCallback(true, null);
            }
        }
		public GameCenter_ScorePlugin_iOS (ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
		{
			#if !IOS_DISABLE_APPLE_SCORES
			this.desc = desc;

			try
			{
				InitGameCenter();
			}
			catch (Exception e)
			{
				Debug.LogError(e.Message);
				if (callback != null) callback(false, e.Message);
				return;
			}

			if (callback != null) callback(true, null);
			#endif
		}
 /// <summary>
 /// Used by the Reign plugin.
 /// </summary>
 /// <param name="desc">Score desc.</param>
 /// <returns>Returns Score plugin interface</returns>
 public static IScorePlugin New(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
 {
                 #if DISABLE_REIGN
     return(new Dumy_ScorePluginPlugin(desc, callback));
                 #elif UNITY_EDITOR
     if (desc.Editor_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.Editor_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported Editor_ScoreAPI: " + desc.Editor_ScoreAPI);
     }
                 #elif UNITY_WP8
     if (desc.WP8_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.WP8_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported WP8_ScoreAPI: " + desc.WP8_ScoreAPI);
     }
                 #elif UNITY_METRO
     if (desc.WinRT_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.WinRT_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported WinRT_ScoreAPI: " + desc.WinRT_ScoreAPI);
     }
                 #elif UNITY_ANDROID
     if (desc.Android_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.Android_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else if (desc.Android_ScoreAPI == ScoreAPIs.GooglePlay)
     {
         return(new GooglePlay_ScorePlugin_Android(desc, callback));
     }
     else if (desc.Android_ScoreAPI == ScoreAPIs.GameCircle)
     {
         return(new Amazon_GameCircle_ScorePlugin_Android(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported Android_ScoreAPI: " + desc.Android_ScoreAPI);
     }
                 #elif UNITY_IOS
     if (desc.iOS_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.iOS_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else if (desc.iOS_ScoreAPI == ScoreAPIs.GameCenter)
     {
         return(new GameCenter_ScorePlugin_iOS(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported iOS_ScoreAPI: " + desc.iOS_ScoreAPI);
     }
                 #elif UNITY_BLACKBERRY
     if (desc.BB10_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.BB10_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported BB10_ScoreAPI: " + desc.BB10_ScoreAPI);
     }
                 #elif UNITY_STANDALONE_WIN
     if (desc.Win32_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.Win32_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported Win32_ScoreAPI: " + desc.Win32_ScoreAPI);
     }
                 #elif UNITY_STANDALONE_OSX
     if (desc.OSX_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.OSX_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported OSX_ScoreAPI: " + desc.OSX_ScoreAPI);
     }
                 #elif UNITY_STANDALONE_LINUX
     if (desc.Linux_ScoreAPI == ScoreAPIs.None)
     {
         return(new Dumy_ScorePluginPlugin(desc, callback));
     }
     else if (desc.Linux_ScoreAPI == ScoreAPIs.ReignScores)
     {
         return(new ReignScores_ScorePlugin(desc, callback));
     }
     else
     {
         throw new Exception("Unsuported Linux_ScoreAPI: " + desc.Linux_ScoreAPI);
     }
                 #else
     return(new Dumy_ScorePluginPlugin(desc, callback));
                 #endif
 }
示例#12
0
		/// <summary>
		/// Used by the Reign plugin.
		/// </summary>
		/// <param name="desc">Score desc.</param>
		/// <returns>Returns Score plugin interface</returns>
		public static IScorePlugin New(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
		{
			#if DISABLE_REIGN
			return new Dumy_ScorePluginPlugin(desc, callback);
			#elif UNITY_EDITOR
			if (desc.Editor_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.Editor_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported Editor_ScoreAPI: " + desc.Editor_ScoreAPI);
			#elif UNITY_WP8
			if (desc.WP8_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.WP8_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported WP8_ScoreAPI: " + desc.WP8_ScoreAPI);
			#elif UNITY_METRO
			if (desc.WinRT_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.WinRT_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported WinRT_ScoreAPI: " + desc.WinRT_ScoreAPI);
			#elif UNITY_ANDROID
			if (desc.Android_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.Android_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else if (desc.Android_ScoreAPI == ScoreAPIs.GooglePlay) return new GooglePlay_ScorePlugin_Android(desc, callback);
			else if (desc.Android_ScoreAPI == ScoreAPIs.GameCircle) return new Amazon_GameCircle_ScorePlugin_Android(desc, callback);
			else throw new Exception("Unsuported Android_ScoreAPI: " + desc.Android_ScoreAPI);
			#elif UNITY_IOS
			if (desc.iOS_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.iOS_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else if (desc.iOS_ScoreAPI == ScoreAPIs.GameCenter) return new GameCenter_ScorePlugin_iOS(desc, callback);
			else throw new Exception("Unsuported iOS_ScoreAPI: " + desc.iOS_ScoreAPI);
			#elif UNITY_BLACKBERRY
			if (desc.BB10_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.BB10_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported BB10_ScoreAPI: " + desc.BB10_ScoreAPI);
			#elif UNITY_STANDALONE_WIN
			if (desc.Win32_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.Win32_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported Win32_ScoreAPI: " + desc.Win32_ScoreAPI);
			#elif UNITY_STANDALONE_OSX
			if (desc.OSX_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.OSX_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported OSX_ScoreAPI: " + desc.OSX_ScoreAPI);
			#elif UNITY_STANDALONE_LINUX
			if (desc.Linux_ScoreAPI == ScoreAPIs.None) return new Dumy_ScorePluginPlugin(desc, callback);
			else if (desc.Linux_ScoreAPI == ScoreAPIs.ReignScores) return new ReignScores_ScorePlugin(desc, callback);
			else throw new Exception("Unsuported Linux_ScoreAPI: " + desc.Linux_ScoreAPI);
			#else
			return new Dumy_ScorePluginPlugin(desc, callback);
			#endif
		}
示例#13
0
		/// <summary>
		/// Dumy constructor.
		/// </summary>
		/// <param name="desc">Score desc.</param>
		public Dumy_ScorePluginPlugin(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
		{
			IsAuthenticated = false;
			Username = "******";
			if (callback != null) callback(false, "Dumy Score object");
		}
		public ReignScores_ScorePlugin(ScoreDesc desc, CreatedScoreAPICallbackMethod callback)
		{
			this.desc = desc;
			#if UNITY_EDITOR
			gameID = desc.Editor_ReignScores_GameID;
			#elif UNITY_STANDALONE_WIN
			gameID = desc.Win32_ReignScores_GameID;
			#elif UNITY_STANDALONE_OSX
			gameID = desc.OSX_ReignScores_GameID;
			#elif UNITY_STANDALONE_LINUX
			gameID = desc.Linux_ReignScores_GameID;
			#elif UNITY_WEBPLAYER
			gameID = desc.Web_ReignScores_GameID;
			#elif UNITY_WEBGL
			gameID = desc.WebGL_ReignScores_GameID;
			#elif UNITY_WP8
			gameID = desc.WP8_ReignScores_GameID;
			#elif UNITY_METRO
			gameID = desc.WinRT_ReignScores_GameID;
			#elif UNITY_BLACKBERRY
			gameID = desc.BB10_ReignScores_GameID;
			#elif UNITY_TIZEN
			gameID = desc.Tizen_ReignScores_GameID;
			#elif UNITY_IPHONE
			gameID = desc.iOS_ReignScores_GameID;
			#elif UNITY_ANDROID
			gameID = desc.Android_ReignScores_GameID;
			#endif

			ui = desc.ReignScores_UI;
			ui.Init(this);
			helper = new ReignScores_ServicesHelper(desc);

			if (callback != null) callback(true, null);
		}