protected void HandleResult(IResult result) { if (result == null) { this.LastResponse = "Null Response\n"; LogView.AddLog(this.LastResponse); return; } this.LastResponseTexture = null; // Some platforms return the empty string instead of null. if (!string.IsNullOrEmpty(result.Error)) { this.Status = "Error - Check log for details"; this.LastResponse = "Error Response:\n" + result.Error; LogView.AddLog(result.Error); } else if (result.Cancelled) { this.Status = "Cancelled - Check log for details"; this.LastResponse = "Cancelled Response:\n" + result.RawResult; LogView.AddLog(result.RawResult); } else if (!string.IsNullOrEmpty(result.RawResult)) { this.Status = "Success - Check log for details"; this.LastResponse = "Success Response:\n" + result.RawResult; LogView.AddLog(result.RawResult); } else { this.LastResponse = "Empty Response\n"; LogView.AddLog(this.LastResponse); } }
private void OnHideUnity(bool isGameShown) { this.Status = "Success - Check log for details"; this.LastResponse = string.Format("Success Response: OnHideUnity Called {0}\n", isGameShown); LogView.AddLog("Is game shown: " + isGameShown); }
private void OnInitComplete() { base.Status = "Success - Check log for details"; base.LastResponse = "Success Response: OnInitComplete Called\n"; LogView.AddLog(string.Format("OnInitCompleteCalled IsLoggedIn='{0}' IsInitialized='{1}'", FB.IsLoggedIn, FB.IsInitialized)); }
protected void HandleResult(IResult result) { if (result == null) { this.LastResponse = "Null Response\n"; LogView.AddLog(this.LastResponse); print(this.LastResponse); return; } this.LastResponseTexture = null; // Some platforms return the empty string instead of null. if (!string.IsNullOrEmpty(result.Error)) { this.Status = "Error - Check log for details"; this.LastResponse = "Error Response:\n" + result.Error; LogView.AddLog(result.Error); print(result.Error); } else if (result.Cancelled) { this.Status = "Cancelled - Check log for details"; this.LastResponse = "Cancelled Response:\n" + result.RawResult; LogView.AddLog(result.RawResult); print(result.RawResult); } else if (!string.IsNullOrEmpty(result.RawResult)) { this.Status = "Success - Check log for details"; this.LastResponse = "Success Response:\n" + result.RawResult; LogView.AddLog(result.RawResult); //result.ResultDictionary.GetValueOrDefault<IDictionary> ("data"); if (result.ResultDictionary.ContainsKey("like")) { string[] reactStrings = new string[6] { "like", "love", "wow", "haha", "sad", "angry" }; Dictionary <string, long> amounts = new Dictionary <string, long> (); for (int i = 0; i < reactStrings.Length; i++) { IDictionary <string, object> d = (IDictionary <string, object>)result.ResultDictionary [reactStrings[i]]; IDictionary <string, object> d2 = (IDictionary <string, object>)d ["summary"]; amounts[reactStrings[i]] = (long)d2 ["total_count"]; } GameManager.instance.getVotes(amounts); for (int i = 0; i < reactStrings.Length; i++) { print(reactStrings [i] + ": " + amounts [reactStrings[i]]); } //string[] a = new string[d.Count]; //d.CopyTo (a, 0); //Debug.Log (a[0]); } } else { this.LastResponse = "Empty Response\n"; LogView.AddLog(this.LastResponse); } }
private void OnInitComplete() { this.Status = "Success - Check logk for details"; this.LastResponse = "Success Response: OnInitComplete Called\n"; LogView.AddLog("OnInitComplete Called"); }
private void OnHideUnity(bool isGameShown) { base.Status = "Success - Check log for details"; base.LastResponse = $"Success Response: OnHideUnity Called {isGameShown}\n"; LogView.AddLog("Is game shown: " + isGameShown); }