public string GetBubbleCreateProgress(string base64URN, string accessToken) { string percentage = "0%"; RestRequest req = new RestRequest(); //Start translation, create bubble string resource = string.Format("viewingservice/v1/{0}/status", base64URN); req.Resource = resource; req.Method = Method.GET; req.AddParameter("Authorization", "Bearer " + accessToken, ParameterType.HttpHeader); req.AddParameter("Content-Type", "application/json;charset=utf-8", ParameterType.HttpHeader); ////force regeneration //req.AddParameter("x-ads-force", "true",ParameterType.HttpHeader); //// will not trigger a real translation, just respond all parameters for translation. //req.AddParameter("x-ads-test", "true", ParameterType.HttpHeader); IRestResponse <BubbleStatus> resp = m_client.Execute <BubbleStatus>(req); if (resp.StatusCode == System.Net.HttpStatusCode.OK && resp.Data != null) { BubbleStatus bt = resp.Data; percentage = bt.progress; } else { logger.Error("error when getting progress. http code:" + resp.StatusCode); logger.Debug(resp.Content); } return(percentage); }
public string GetBubbleCreateProgress(string base64URN, string accessToken) { string percentage = "0%"; RestRequest req = new RestRequest(); //Start translation, create bubble string resource = string.Format("viewingservice/v1/{0}/status", base64URN); req.Resource = resource; req.Method = Method.GET; req.AddParameter("Authorization", "Bearer " + accessToken, ParameterType.HttpHeader); req.AddParameter("Content-Type", "application/json;charset=utf-8", ParameterType.HttpHeader); ////force regeneration //req.AddParameter("x-ads-force", "true",ParameterType.HttpHeader); //// will not trigger a real translation, just respond all parameters for translation. //req.AddParameter("x-ads-test", "true", ParameterType.HttpHeader); IRestResponse <BubbleStatus> resp = m_client.Execute <BubbleStatus>(req); if (resp.StatusCode == System.Net.HttpStatusCode.OK && resp.Data != null) { BubbleStatus bt = resp.Data; //if (string.Equals("complete",bt.progress, StringComparison.CurrentCultureIgnoreCase)) //{ // percentage = "100%"; //} percentage = bt.success; } return(percentage); }
protected Bubble(long time, BubbleDirection direction, Service service) { Status = BubbleStatus.Waiting; Time = time; Direction = direction; Service = service; }
public void kill() { canBeTouched = false; if (anim != null) { anim.SetInteger("Status", 1); } try { currentStatus = BubbleStatus.death; updateAnimation(); StartCoroutine(killIenumerator()); } catch { } }
void statusUpdater() { updateAnimation(); if (touchs == 1) { if (currentStatus != BubbleStatus.death) { currentStatus = BubbleStatus.touched; } if (canBeTouched == true) { TouchInnerBubble(this.bubbleColor); } } else { if (currentStatus != BubbleStatus.death) { currentStatus = BubbleStatus.stand; } UntouchInnerBubble(this.bubbleColor); } }
void Start() { currentStatus = BubbleStatus.stand; updateAnimation(); setColor(bubbleColor); }