void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 50), _campaignsAvailable ? "Open Zone 1" : "Waiting...")) { if (_campaignsAvailable) { UnityAdsExternal.Log("Open Zone 1 -button clicked"); UnityAds.show("16-default"); } } if (GUI.Button(new Rect(10, 70, 150, 50), _campaignsAvailable ? "Open Zone 2" : "Waiting...")) { if (_campaignsAvailable) { UnityAdsExternal.Log("Open Zone 2 -button clicked"); UnityAds.show("16-default", "ship", new Dictionary <string, string> { { "openAnimated", "true" }, { "noOfferScreen", "true" }, { "sid", "testiSid" }, { "muteVideoSounds", "true" }, { "useDeviceOrientationForVideo", "true" } }); } } }
public void onVideoStarted() { if (_videoStartedDelegate != null) { _videoStartedDelegate(); } UnityAdsExternal.Log("onVideoStarted"); }
public void onFetchFailed() { _campaignsAvailable = false; if (_campaignsFetchFailedDelegate != null) { _campaignsFetchFailedDelegate(); } UnityAdsExternal.Log("onFetchFailed"); }
public void onFetchCompleted() { _campaignsAvailable = true; if (_campaignsAvailableDelegate != null) { _campaignsAvailableDelegate(); } UnityAdsExternal.Log("onFetchCompleted"); }
/* Events */ public void onHide() { _adsShow = false; AudioListener.pause = false; AudioListener.volume = _savedAudioVolume; Time.timeScale = _savedTimeScale; if (_adsHideDelegate != null) { _adsHideDelegate(); } UnityAdsExternal.Log("onHide"); }
public void onVideoCompleted(string parameters) { if (parameters != null) { List <string> splittedParameters = new List <string>(parameters.Split(';')); string rewardItemKey = splittedParameters.ToArray().GetValue(0).ToString(); bool skipped = splittedParameters.ToArray().GetValue(1).ToString() == "true" ? true : false; if (_videoCompletedDelegate != null) { _videoCompletedDelegate(rewardItemKey, skipped); } UnityAdsExternal.Log("onVideoCompleted: " + rewardItemKey + " - " + skipped); } }
public static Dictionary <string, string> getRewardItemDetailsWithKey(string rewardItemKey) { Dictionary <string, string> retDict = new Dictionary <string, string>(); string rewardItemDataString = ""; if (_campaignsAvailable) { rewardItemDataString = UnityAdsExternal.getRewardItemDetailsWithKey(rewardItemKey); if (rewardItemDataString != null) { List <string> splittedData = new List <string>(rewardItemDataString.Split(';')); UnityAdsExternal.Log("UnityAndroid: getRewardItemDetailsWithKey() rewardItemDataString=" + rewardItemDataString); if (splittedData.Count == 2) { retDict.Add(getRewardItemNameKey(), splittedData.ToArray().GetValue(0).ToString()); retDict.Add(getRewardItemPictureKey(), splittedData.ToArray().GetValue(1).ToString()); } } } return(retDict); }
public void onShow() { UnityAdsExternal.Log("onShow"); }