public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
        {
            // find achievement desc
            AchievementDesc found = null;

            foreach (var a in desc.AchievementDescs)
            {
                if (a.ID == achievementID)
                {
                    found = a;
                }
            }
            if (found == null)
            {
                throw new Exception("Failed to find AchievementID: " + achievementID);
            }

            // make sure value within range
            if (percentComplete > found.PercentCompletedAtValue)
            {
                percentComplete = found.PercentCompletedAtValue;
            }

            // if non-incremental achievement, then force percent complete to 100%
            if (!found.IsIncremental)
            {
                percentComplete = found.PercentCompletedAtValue;
            }

            // request
            reportAchievementCallback = callback;
            native.CallStatic("ReportAchievement", findAchievementID(achievementID), (percentComplete / found.PercentCompletedAtValue) * 100f);
        }
 /// <summary>
 /// Dumy method.
 /// </summary>
 /// <param name="achievementID"></param>
 /// <param name="percentComplete"></param>
 /// <param name="callback"></param>
 /// <param name="services"></param>
 public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
 {
     if (callback != null)
     {
         callback(false, "Dumy Score Obj");
     }
 }
		public void ReportAchievement (string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
		{
			// find achievement desc
			AchievementDesc found = null;
			foreach (var a in desc.AchievementDescs)
			{
				if (a.ID == achievementID) found =  a;
			}
			if (found == null) throw new Exception("Failed to find AchievementID: " + achievementID);

			// report
			reportAchievementCallback = callback;
			native.CallStatic("ReportAchievement", findAchievementID(achievementID), percentComplete, found.IsIncremental);
		}
        /// <summary>
        /// Use to report a achievement.
        /// </summary>
        /// <param name="achievementID">Achievement ID.</param>
        /// <param name="percentComplete">Percent Complete.</param>
        /// <param name="callback">The callback that fires when done.</param>
        public static void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback)
        {
            if (waitingForOperation)
            {
                Debug.LogError("Must wait for last Score operation to complete.");
                return;
            }

            // make sure percent is within range
            if (percentComplete < 0f)
            {
                percentComplete = 0f;
            }

            waitingForOperation       = true;
            reportAchievementCallback = callback;
            plugin.ReportAchievement(achievementID, percentComplete, async_reportAchievementCallback, ReignServices.Singleton);
        }
        public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
        {
            // find achievement
            var achievementDesc = findAchievement(achievementID);

            if (achievementDesc == null)
            {
                if (callback != null)
                {
                    callback(false, "Failed to find achievementID: " + achievementID);
                }
                return;
            }

                        #if UNITY_EDITOR
            var serverAchievementID = achievementDesc.Editor_ReignScores_ID;
                        #elif UNITY_STANDALONE_WIN
            var serverAchievementID = achievementDesc.Win32_ReignScores_ID;
                        #elif UNITY_STANDALONE_OSX
            var serverAchievementID = achievementDesc.OSX_ReignScores_ID;
                        #elif UNITY_STANDALONE_LINUX
            var serverAchievementID = achievementDesc.Linux_ReignScores_ID;
                        #elif UNITY_WEBPLAYER
            var serverAchievementID = achievementDesc.Web_ReignScores_ID;
                        #elif UNITY_WEBGL
            var serverAchievementID = achievementDesc.WebGL_ReignScores_ID;
                        #elif UNITY_WP8
            var serverAchievementID = achievementDesc.WP8_ReignScores_ID;
                        #elif UNITY_METRO
            var serverAchievementID = achievementDesc.WinRT_ReignScores_ID;
                        #elif UNITY_BLACKBERRY
            var serverAchievementID = achievementDesc.BB10_ReignScores_ID;
                        #elif UNITY_TIZEN
            var serverAchievementID = achievementDesc.Tizen_ReignScores_ID;
                        #elif UNITY_IPHONE
            var serverAchievementID = achievementDesc.iOS_ReignScores_ID;
                        #elif UNITY_ANDROID
            var serverAchievementID = achievementDesc.Android_ReignScores_ID;
                        #endif

            // submit achievement
            ReportAchievement_callback = callback;
            helper.InvokeServiceMethod(ReignScores_ServiceTypes.Users, "ReportAchievement", reportAchievementCallback, services, "user_id=" + UserID, "achievement_id=" + serverAchievementID, "percent_complete=" + ((percentComplete / achievementDesc.PercentCompletedAtValue) * 100f));
        }
		public void ReportAchievement (string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
		{
			// find achievement desc
			AchievementDesc found = null;
			foreach (var a in desc.AchievementDescs)
			{
				if (a.ID == achievementID) found = a;
			}
			if (found == null) throw new Exception("Failed to find AchievementID: " + achievementID);

			// make sure value within range
			if (percentComplete > found.PercentCompletedAtValue) percentComplete = found.PercentCompletedAtValue;

			// if non-incremental achievement, then force percent complete to 100%
			if (!found.IsIncremental) percentComplete = found.PercentCompletedAtValue;

			// request
			reportAchievementCallback = callback;
			native.CallStatic("ReportAchievement", findAchievementID(achievementID), (percentComplete / found.PercentCompletedAtValue) * 100f);
		}
        public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
        {
            // find achievement desc
            AchievementDesc found = null;

            foreach (var a in desc.AchievementDescs)
            {
                if (a.ID == achievementID)
                {
                    found = a;
                }
            }
            if (found == null)
            {
                throw new Exception("Failed to find AchievementID: " + achievementID);
            }

            // report
            reportAchievementCallback = callback;
            native.CallStatic("ReportAchievement", findAchievementID(achievementID), percentComplete, found.IsIncremental);
        }
Ejemplo n.º 8
0
		/// <summary>
		/// Dumy method.
		/// </summary>
		/// <param name="achievementID"></param>
		/// <param name="percentComplete"></param>
		/// <param name="callback"></param>
		/// <param name="services"></param>
		public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
		{
			if (callback != null) callback(false, "Dumy Score Obj");
		}
Ejemplo n.º 9
0
		/// <summary>
		/// Use to report a achievement.
		/// </summary>
		/// <param name="achievementID">Achievement ID.</param>
		/// <param name="percentComplete">Percent Complete.</param>
		/// <param name="callback">The callback that fires when done.</param>
		public static void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback)
		{
			if (waitingForOperation)
			{
				Debug.LogError("Must wait for last Score operation to complete.");
				return;
			}

			// make sure percent is within range
			if (percentComplete < 0f) percentComplete = 0f;

			waitingForOperation = true;
			reportAchievementCallback = callback;
			plugin.ReportAchievement(achievementID, percentComplete, async_reportAchievementCallback, ReignServices.Singleton);
		}
		public void ReportAchievement(string achievementID, float percentComplete, ReportAchievementCallbackMethod callback, MonoBehaviour services)
		{
			// find achievement
			var achievementDesc = findAchievement(achievementID);
			if (achievementDesc == null)
			{
				if (callback != null) callback(false, "Failed to find achievementID: " + achievementID);
				return;
			}

			#if UNITY_EDITOR
			var serverAchievementID = achievementDesc.Editor_ReignScores_ID;
			#elif UNITY_STANDALONE_WIN
			var serverAchievementID = achievementDesc.Win32_ReignScores_ID;
			#elif UNITY_STANDALONE_OSX
			var serverAchievementID = achievementDesc.OSX_ReignScores_ID;
			#elif UNITY_STANDALONE_LINUX
			var serverAchievementID = achievementDesc.Linux_ReignScores_ID;
			#elif UNITY_WEBPLAYER
			var serverAchievementID = achievementDesc.Web_ReignScores_ID;
			#elif UNITY_WEBGL
			var serverAchievementID = achievementDesc.WebGL_ReignScores_ID;
			#elif UNITY_WP8
			var serverAchievementID = achievementDesc.WP8_ReignScores_ID;
			#elif UNITY_METRO
			var serverAchievementID = achievementDesc.WinRT_ReignScores_ID;
			#elif UNITY_BLACKBERRY
			var serverAchievementID = achievementDesc.BB10_ReignScores_ID;
			#elif UNITY_TIZEN
			var serverAchievementID = achievementDesc.Tizen_ReignScores_ID;
			#elif UNITY_IPHONE
			var serverAchievementID = achievementDesc.iOS_ReignScores_ID;
			#elif UNITY_ANDROID
			var serverAchievementID = achievementDesc.Android_ReignScores_ID;
			#endif

			// submit achievement
			ReportAchievement_callback = callback;
			helper.InvokeServiceMethod(ReignScores_ServiceTypes.Users, "ReportAchievement", reportAchievementCallback, services, "user_id="+UserID, "achievement_id="+serverAchievementID, "percent_complete="+((percentComplete / achievementDesc.PercentCompletedAtValue) * 100f));
		}