public static bool showImpact(string zoneId, string rewardItemKey, Dictionary <string, string> options) { if (!_impactOpen && _campaignsAvailable) { if (SharedInstance) { string optionsString = parseOptionsDictionary(options); if (ApplifierImpactMobileExternal.showImpact(zoneId, rewardItemKey, optionsString)) { if (_impactOpenDelegate != null) { _impactOpenDelegate(); } _impactOpen = true; _savedTimeScale = Time.timeScale; _savedAudioVolume = AudioListener.volume; AudioListener.pause = true; AudioListener.volume = 0; Time.timeScale = 0; return(true); } } } return(false); }
void OnGUI() { if (GUI.Button(new Rect(10, 10, 150, 50), _campaignsAvailable ? "Open Zone 1" : "Waiting...")) { if (_campaignsAvailable) { ApplifierImpactMobileExternal.Log("Open Zone 1 -button clicked"); ApplifierImpactMobile.showImpact("16-default"); } } if (GUI.Button(new Rect(10, 70, 150, 50), _campaignsAvailable ? "Open Zone 2" : "Waiting...")) { if (_campaignsAvailable) { ApplifierImpactMobileExternal.Log("Open Zone 2 -button clicked"); ApplifierImpactMobile.showImpact("16-default", "ship", new Dictionary <string, string> { { "openAnimated", "true" }, { "noOfferScreen", "true" }, { "sid", "testiSid" }, { "muteVideoSounds", "true" }, { "useDeviceOrientationForVideo", "true" } }); } } }
public static void setDefaultRewardItemAsRewardItem() { if (_campaignsAvailable) { ApplifierImpactMobileExternal.setDefaultRewardItemAsRewardItem(); } }
public static void hideImpact() { if (_impactOpen) { ApplifierImpactMobileExternal.hideImpact(); } }
public static string getCurrentRewardItemKey() { if (_campaignsAvailable) { return(ApplifierImpactMobileExternal.getCurrentRewardItemKey()); } return(""); }
public static bool hasMultipleRewardItems() { if (_campaignsAvailable) { return(ApplifierImpactMobileExternal.hasMultipleRewardItems()); } return(false); }
public static bool setRewardItemKey(string rewardItemKey) { if (_campaignsAvailable) { return(ApplifierImpactMobileExternal.setRewardItemKey(rewardItemKey)); } return(false); }
public static bool canShowImpact() { if (_campaignsAvailable) { return(ApplifierImpactMobileExternal.canShowImpact()); } return(false); }
public void onVideoStarted() { if (_videoStartedDelegate != null) { _videoStartedDelegate(); } ApplifierImpactMobileExternal.Log("onVideoStarted"); }
public void onCampaignsFetchFailed() { _campaignsAvailable = false; if (_campaignsFetchFailedDelegate != null) { _campaignsFetchFailedDelegate(); } ApplifierImpactMobileExternal.Log("onCampaignsFetchFailed"); }
public void onCampaignsAvailable() { _campaignsAvailable = true; if (_campaignsAvailableDelegate != null) { _campaignsAvailableDelegate(); } ApplifierImpactMobileExternal.Log("onCampaignsAvailable"); }
private static void fillRewardItemKeyData() { string keyData = ApplifierImpactMobileExternal.getRewardItemDetailsKeys(); if (keyData != null && keyData.Length > 2) { List <string> splittedKeyData = new List <string>(keyData.Split(';')); _rewardItemNameKey = splittedKeyData.ToArray().GetValue(0).ToString(); _rewardItemPictureKey = splittedKeyData.ToArray().GetValue(1).ToString(); } }
public static List <string> getRewardItemKeys() { List <string> retList = new List <string>(); if (_campaignsAvailable) { string keys = ApplifierImpactMobileExternal.getRewardItemKeys(); retList = new List <string>(keys.Split(';')); } return(retList); }
/* Events */ public void onImpactClose() { _impactOpen = false; AudioListener.pause = false; AudioListener.volume = _savedAudioVolume; Time.timeScale = _savedTimeScale; if (_impactCloseDelegate != null) { _impactCloseDelegate(); } ApplifierImpactMobileExternal.Log("onImpactClose"); }
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); } ApplifierImpactMobileExternal.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 = ApplifierImpactMobileExternal.getRewardItemDetailsWithKey(rewardItemKey); if (rewardItemDataString != null) { List <string> splittedData = new List <string>(rewardItemDataString.Split(';')); ApplifierImpactMobileExternal.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); }
/* Static Methods */ public static bool isSupported() { return(ApplifierImpactMobileExternal.isSupported()); }
public void onImpactOpen() { ApplifierImpactMobileExternal.Log("onImpactOpen"); }
public static void stopAll() { ApplifierImpactMobileExternal.stopAll(); }
public static string getSDKVersion() { return(ApplifierImpactMobileExternal.getSDKVersion()); }