// Use this for initialization void Awake() { if (instance != null) { Destroy(this.gameObject); return; } DontDestroyOnLoad(this.gameObject); instance = this; adsEnabled = true; if (areAdsAlreadyRemoved()) { disableAds(); } admobHandler = gameObject.AddComponent <AdmobHandler>(); chartboostHandler = gameObject.AddComponent <ChartboostHandler>(); if (InitializeNetworksOnStart) { InitializeNetworks(); } }
public virtual void HandleHide() { GameCommunity.HideActionAppRate(); GameCommunity.HideSharesCenter(); AdNetworks.HideAd(); }
public override void OnButtonClickEventHandler(string buttonName) { //LogUtil.Log("OnButtonClickEventHandler: " + buttonName); if (UIUtil.IsButtonClicked(buttonEarnVideoAds, buttonName)) { LogUtil.Log("buttonEarnVideoAds: " + buttonName); AdNetworks.ShowVideoAd(); } else if (UIUtil.IsButtonClicked(buttonEarnOffers, buttonName)) { LogUtil.Log("buttonEarnOffers: " + buttonName); AdNetworks.ShowOfferWall(); } else if (UIUtil.IsButtonClicked(buttonEarnMoreGames, buttonName)) { LogUtil.Log("buttonEarnMoreGames: " + buttonName); AdNetworks.ShowMoreApps(); } else if (UIUtil.IsButtonClicked(buttonEarnFacebook, buttonName)) { LogUtil.Log("buttonEarnFacebook: " + buttonName); OnFacebookLike("default"); GameCommunity.LikeUrl( SocialNetworkTypes.facebook, Locos.Get(LocoKeys.app_web_url)); } else if (UIUtil.IsButtonClicked(buttonEarnTwitter, buttonName)) { LogUtil.Log("buttonEarnTwitter: " + buttonName); OnTwitterFollow("default"); Platforms.ShowWebView( Locos.Get(LocoKeys.app_display_name), Locos.Get(LocoKeys.app_web_url_twitter)); } else if (UIUtil.IsButtonClicked(buttonEarnWebsite, buttonName)) { LogUtil.Log("buttonEarnWebsite: " + buttonName); OnWebsiteViewed("default"); Platforms.ShowWebView( Locos.Get(LocoKeys.app_display_name), Locos.Get(LocoKeys.app_web_url)); } else if (UIUtil.IsButtonClicked(buttonEarnViewFullscreenAds, buttonName)) { LogUtil.Log("buttonEarnViewFullscreenAds: " + buttonName); AdNetworks.ShowFullscreenAd(); } }
/// <summary> /// Creates a channel element with source site info /// </summary> /// <returns>Returns <see cref="XElement"/> that represents a channel tag in the yandex turbo feed.</returns> public XElement ToXElement() { IEnumerable <XElement> analyticsCollection = Analytics?.Select(analytics => analytics.ToXElement()) ?? new List <XElement>(); IEnumerable <XElement> adNetworkCollection = AdNetworks?.Select(ads => ads.ToXElement()) ?? new List <XElement>(); IEnumerable <XElement> items = Items?.Select(item => item.ToXElement()) ?? new List <XElement>(); return(new XElement( "channel", new XElement("title", Title), new XElement("link", Link?.ToString()), new XElement("description", Description), new XElement("language", Language), analyticsCollection, adNetworkCollection, items)); }
public void HandleAdDisplay() { // handle character display if (adDisplayState == UIPanelAdDisplayState.BannerBottom || adDisplayState == UIPanelAdDisplayState.BannerTop) { // TODO handle types... AdNetworks.ShowAd(); } else { AdNetworks.HideAd(); } }
public virtual void Update() { AdNetworks.HandleAdUpdate(); #if !UNITY_IPHONE if (Input.GetKeyDown(KeyCode.Escape)) { QuitGame(); //if(AlertDialog.Instance.IsReady()) { // AlertDialog.Instance.ShowAlertQuitDialog(); //} } #endif if (Application.isEditor) { if (Input.GetKeyDown(KeyCode.Comma)) { string sceneName = "Panel"; if (GameUIController.Instance != null) { sceneName = GameUIController.Instance.currentPanel; } string filename = "../screenshots/" + sceneName + "-" + Screen.width.ToString() + "x" + Screen.height.ToString() + "-" + (screenshotCount++).ToString() + ".png"; if (GameController.IsGameRunning) { filename = "../screenshots/" + sceneName + "-gameplay-" + "-" + Screen.width.ToString() + "x" + Screen.height.ToString() + "-" + (screenshotCount++).ToString() + ".png"; } Application.CaptureScreenshot(filename); } } }
public virtual void AnimateOut(float time, float delay) { if (!isVisible) { return; } //HideCamera(); HandleHide(); AdNetworks.HideAd(); AnimateOutCenter(time, delay); AnimateOutLeft(time, delay); AnimateOutLeftBottom(time, delay); AnimateOutLeftTop(time, delay); AnimateOutRight(time, delay); AnimateOutRightBottom(time, delay); AnimateOutRightTop(time, delay); AnimateOutTop(time, delay); AnimateOutBottom(time, delay); ListClear(); if (panelContainer != null) { if (!panelContainer.activeSelf || !panelContainer.activeInHierarchy) { panelContainer.Hide(); } else { StartCoroutine(HidePanelCo(delay + .5f)); } } isVisible = false; }
public virtual void InitAds() { adNetworks = gameObject.AddComponent <AdNetworks>(); }
public virtual void Update() { AdNetworks.HandleAdUpdate(); #if !UNITY_IPHONE if (Input.GetKeyDown(KeyCode.Escape)) { QuitGame(); //if(AlertDialog.Instance.IsReady()) { // AlertDialog.Instance.ShowAlertQuitDialog(); //} } #endif if (Application.isEditor) { if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))) { if (Input.GetKeyDown(KeyCode.P)) { #if UNITY_EDITOR // Toggle paused //UnityEditor.EditorApplication.isPaused = // !UnityEditor.EditorApplication.isPaused ? true : false; UnityEditor.EditorApplication.isPaused = !UnityEditor.EditorApplication.isPaused; #endif } else if (Input.GetKeyDown(KeyCode.E) && (Input.GetKeyDown(KeyCode.Plus) || Input.GetKeyDown(KeyCode.KeypadPlus))) { // volume up for effects currentVolumeEffects += currentVolumeInc; UpdateAudio(currentVolumeMusic, currentVolumeEffects); } else if (Input.GetKeyDown(KeyCode.E) && (Input.GetKeyDown(KeyCode.Minus) || Input.GetKeyDown(KeyCode.KeypadMinus))) { // volume up for effects currentVolumeEffects -= currentVolumeInc; UpdateAudio(currentVolumeMusic, currentVolumeEffects); } else if (Input.GetKeyDown(KeyCode.M) && (Input.GetKeyDown(KeyCode.Plus) || Input.GetKeyDown(KeyCode.KeypadPlus))) { // volume up for music currentVolumeMusic += currentVolumeInc; UpdateAudio(currentVolumeMusic, currentVolumeEffects); } else if (Input.GetKeyDown(KeyCode.M) && (Input.GetKeyDown(KeyCode.Minus) || Input.GetKeyDown(KeyCode.KeypadMinus))) { // volume up for music currentVolumeMusic -= currentVolumeInc; UpdateAudio(currentVolumeMusic, currentVolumeEffects); } } if (Input.GetKeyDown(KeyCode.Comma)) { string sceneName = "Panel"; if (GameUIController.Instance != null) { sceneName = GameUIController.Instance.currentPanel; } string filename = "../screenshots/" + sceneName + "-" + Screen.width.ToString() + "x" + Screen.height.ToString() + "-" + (screenshotCount++).ToString() + ".png"; if (GameController.IsGameRunning) { filename = "../screenshots/" + sceneName + "-gameplay-" + "-" + Screen.width.ToString() + "x" + Screen.height.ToString() + "-" + (screenshotCount++).ToString() + ".png"; } Application.CaptureScreenshot(filename); } } }