public new void WriteXml(System.Xml.XmlWriter writer) { base.WriteXml(writer); writer.WriteElementString("PollType", PollType.ToString("D")); writer.WriteElementString("ShowAnswerCount", ShowAnswerCount.ToString("D")); writer.WriteElementString("ShowResult", ShowResult.ToString("D")); writer.WriteElementString("PollLayout", PollLayout.ToString("D")); writer.WriteElementString("AnonymousAllowed", AnonymousAllowed.ToString()); writer.WriteElementString("HasAnswers", HasAnswers.ToString()); writer.WriteElementString("AnswerAnonnymous", AnswerAnonnymous.ToString()); writer.WriteElementString("AnswerRegisterd", AnswerRegisterd.ToString()); writer.WriteElementString("AnswerTotal", AnswerTotal.ToString()); writer.WriteElementString("TextRight", TextRight); writer.WriteElementString("TextFalse", TextFalse); writer.WriteElementString("TextPartially", TextPartially); writer.WriteStartElement("Answers"); foreach (PollAnswer kvp in Answers) { writer.WriteStartElement("Answer"); writer.WriteAttributeString("Position", kvp.Position.ToString()); writer.WriteAttributeString("Anonnymous", kvp.Anonnymous.ToString()); writer.WriteAttributeString("Registerd", kvp.Registerd.ToString()); writer.WriteAttributeString("IsRight", kvp.IsRight.ToString()); writer.WriteString(kvp.Answer); writer.WriteEndElement(); } writer.WriteEndElement(); }
private void HandleClosingOfAd(ShowResult result) { Debug.Log(result.ToString()); if (result == ShowResult.Finished) { PlayerController.DieOnMiss = false; OnOfferPass(); } }
void HandleShowResult(string placementId, ShowResult result, System.Action <ShowResult> onDoneCallback) { Debug.Log("Advertisement '" + placementId + "' returned result: " + result.ToString()); isAdRunning = false; if (onDoneCallback != null) { onDoneCallback(result); } }
public void OnWatchAdsComplete(ShowResult result) { IDictionary <string, object> eventArgs = new Dictionary <string, object>(); eventArgs.Add(kResult, result.ToString().ToLower()); Analytics.CustomEvent(kOnWatchAdsCompleted, eventArgs); int watchAdsCount = Player.GetAdsCompletedCount(); watchAdsCount++; Player.SetAdsCompletedCount(watchAdsCount); eventArgs = new Dictionary <string, object>(); eventArgs.Add(kCount, watchAdsCount); Analytics.CustomEvent(kOnWatchAdsCompletedCount, eventArgs); }
public void OnUnityAdsDidFinish(string _placementId, ShowResult _showResult) { // Define conditional logic for each ad completion status: if (_showResult == ShowResult.Finished) { // Reward the user for watching the ad to completion. if (_placementId == ConstantsAds.REWARDED) { GameManager.Instance.adsToday++; } else if (_placementId == ConstantsAds.INTERSTITIAL) { GameManager.Instance.countReturnToMainMenu = 0; } callback?.Invoke(); } else if (_showResult == ShowResult.Skipped) { // Do not reward the user for skipping the ad. if (_placementId == ConstantsAds.REWARDED) { GameManager.Instance.adsToday++; } else if (_placementId == ConstantsAds.INTERSTITIAL) { GameManager.Instance.countReturnToMainMenu = 0; } badCallback?.Invoke(); } else if (_showResult == ShowResult.Failed) { //Debug.LogWarning(“The ad did not finish due to an error.”); badCallback?.Invoke(); } Debug.LogWarning(_showResult.ToString()); }
void CallbackAD(ShowResult _result) { m_AdResult = _result; Debug.Log("showResutl : " + m_AdResult.ToString()); }
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult) { if (debug) { Debug.Log(this + "OnUnityAdsDidFinish " + placementId + " ShowResult " + showResult); ScreenWriter.Write(this + "OnUnityAdsDidFinish " + placementId + " ShowResult " + showResult); } if (placementId == videoAdPlacement) { if (debug) { Debug.Log(this + "Interstitial result: " + showResult); ScreenWriter.Write(this + "Interstitial result: " + showResult); } if (OnInterstitialClosed != null) { OnInterstitialClosed(); OnInterstitialClosed = null; } if (OnInterstitialClosedWithAdvertiser != null) { OnInterstitialClosedWithAdvertiser(SupportedAdvertisers.Unity.ToString()); OnInterstitialClosedWithAdvertiser = null; } } if (placementId == rewardedVideoAdPlacement) { if (debug) { Debug.Log(this + "Complete method result: " + showResult.ToString()); ScreenWriter.Write(this + "Complete method result: " + showResult.ToString()); } if (showResult == ShowResult.Finished) { if (OnCompleteMethod != null) { OnCompleteMethod(true); OnCompleteMethod = null; } if (OnCompleteMethodWithAdvertiser != null) { OnCompleteMethodWithAdvertiser(true, SupportedAdvertisers.Unity.ToString()); OnCompleteMethodWithAdvertiser = null; } } else { if (OnCompleteMethod != null) { OnCompleteMethod(false); OnCompleteMethod = null; } if (OnCompleteMethodWithAdvertiser != null) { OnCompleteMethodWithAdvertiser(false, SupportedAdvertisers.Unity.ToString()); OnCompleteMethodWithAdvertiser = null; } } } }
private void HandleShowAdDone(ShowResult result) { progressText.text = "Callback result: " + result.ToString(); }
private void HandleClosingOfAd(ShowResult result) { Debug.Log(string.Format("{0}", result.ToString())); }