示例#1
0
 public void CheckAndShowBannerIfNeed()
 {
     if (!InhouseSDK.getInstance().IsInGame)
     {
         showBannerAd();
     }
 }
示例#2
0
 public override void ShowIntersitial()
 {
     if (_manager._didInit && !InhouseSDK.getInstance().getIsPro())
     {
         Advertisement.Show(_config.SkippedKey);
     }
 }
示例#3
0
 public void CheckAndShowIntersitial(bool forceShow = false)
 {
     HDDebug.Log("ShowIntersitial: " + (_config.Ads.AdsType != null).ToString());
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         int ratio = UnityEngine.Random.Range(0, 100);
         if (forceShow || ratio < _config.Ads.DisplayFrequencyOfInterstitial)
         {
             foreach (KeyValuePair <string, string> item in _config.Ads.AdsType)
             {
                 if (item.Key == TAG_ADSTYPE_INTERSITIAL)
                 {
                     BaseAds ads = _ads [item.Value];
                     if (ads != null)
                     {
                         ads.ShowIntersitial();
                     }
                     else
                     {
                         HDDebug.Log("AdsMgr: " + item.Key + " not supported");
                     }
                 }
             }
         }
     }
 }
示例#4
0
 public void checkAndShowRemoveAd(Action <bool> callback = null)
 {
     if (_didInit)
     {
         if (!InhouseSDK.getInstance().getIsPro())
         {
             InhouseSDK.Language content = _config.RemoveAds.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage());
             if (content == null)
             {
                 content = _config.RemoveAds.Languages.getLanguage("en");
             }
             if (content != null)
             {
                 string title   = content.Title;
                 string message = content.Message;
                 string ok      = content.OK;
                 string cancel  = content.Cancel;
                 _callback = callback;
                 InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, "", (string respone) => {
                     if (respone == "0")
                     {
                         RemoveAds(callback);
                     }
                 });
             }
         }
     }
 }
示例#5
0
 public void showIntersitialAd()
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         AdmobManager.getInstance().ShowInterstitial();
     }
 }
示例#6
0
 public override void HideBanner()
 {
     if (!_manager._didInit || InhouseSDK.getInstance().getIsPro())
     {
         return;
     }
     AdmobManager.getInstance().HideBanner();
 }
示例#7
0
 public void RemoveAds(Action <bool> callback)
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         _callback = callback;
         InhouseSDK.getInstance().BuyProduct(_config.RemoveAds.ProductID, OnRemoveAdsSuccess, OnRemoveAdsFaild);
     }
 }
示例#8
0
 public override void ShowBanner()
 {
     if (!_manager._didInit || InhouseSDK.getInstance().getIsPro())
     {
         return;
     }
     AdmobManager.getInstance().ShowBanner(_config.BannerId,
                                           AdsMgr.BannerPosition == AdBannerPosition.Bottom ? GoogleMobileAds.Api.AdPosition.Bottom : GoogleMobileAds.Api.AdPosition.Top);
 }
示例#9
0
 public override void ShowIntersitial()
 {
     Debug.Log("AdmobMgr: ShowIntersitial1");
     if (_manager._didInit && !InhouseSDK.getInstance().getIsPro())
     {
         Debug.Log("AdmobMgr: ShowIntersitial2");
         AdmobManager.getInstance().ShowInterstitial(_config.IntersitialId, true);
     }
 }
示例#10
0
    void logEvent()
    {
        FirebaseAnalyticMgr fb = InhouseSDK.getInstance().GetManager <FirebaseAnalyticMgr> ();

        if (fb != null)
        {
            fb.LogEvent(InhouseSDK.FB_EVENT_ADSERVICE_CLICK);
        }
    }
示例#11
0
 public static InhouseSDK getInstance()
 {
     if (_instance == null)
     {
         _instance = new GameObject().AddComponent <InhouseSDK> ();
         _instance.gameObject.name = "InhouseSDKManager";
         DontDestroyOnLoad(_instance.gameObject);
         Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
     }
     return(_instance);
 }
示例#12
0
    private void OnRemoveAdsSuccess(string message)
    {
        _config.IsBuyPro = true;
        InhouseSDK.getInstance().SaveConfigToLocal();

        InhouseSDK.getInstance().GetManager <AdsMgr>().HideBanner();
        if (_callback != null)
        {
            _callback(true);
            _callback = null;
        }
    }
示例#13
0
 public void showBannerAd()
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         AdmobManager.getInstance().ShowBanner(_config.GoogleAds.BannerAdUnitID, BannerPosition);
         Debug.Log("Show banner");
     }
     else
     {
         Debug.Log("Can not show banner");
     }
 }
示例#14
0
 public void requestIntersitial()
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro() && _config.GoogleAds.UsingAdModInterstitial)
     {
         int ratio = UnityEngine.Random.Range(0, 100);
         if (ratio < _config.GoogleAds.DisplayFrequencyOfInterstitial)
         {
             Debug.Log("AdmobMgr: request intersitial");
             AdmobManager.getInstance().RequestInterstitial(_config.GoogleAds.InterstitialAdUnitID);
         }
     }
 }
示例#15
0
    private void OnRestoreSuccess(string message)
    {
        _config.IsBuyPro = true;
        InhouseSDK.getInstance().SaveConfigToLocal();

        InhouseSDK.getInstance().GetManager <AdsMgr>().HideBanner();
        InhouseSDK.getInstance().ShowPopup("", "Restore purchase successfully", "OK", "", "", _ClosePopup);
        if (_callback != null)
        {
            _callback(true);
            _callback = null;
        }
    }
示例#16
0
 public void ReloadBanner()
 {
     Debug.Log("Is in game: " + InhouseSDK.getInstance().IsInGame.ToString());
     if (InhouseSDK.getInstance().IsInGame)
     {
         if (_didInit && !InhouseSDK.getInstance().getIsPro())
         {
             Debug.Log("Show banner");
             AdmobManager.getInstance().ReloadBanner(_config.GoogleAds.BannerAdUnitID, BannerPosition);
         }
         else
         {
             Debug.Log("Can not show banner");
         }
     }
 }
示例#17
0
    public override void InitWithConfig(Hashtable data)
    {
        base.InitWithConfig(data);
        if (data == null)
        {
            return;
        }
        data = (Hashtable)data["GameCenter"];
        if (data == null)
        {
            return;
        }

        Dictionary <string, string> list = InhouseSDK.HashtableToDictionary <string, string> (data);

        _config.GameCenter.LeaderboardIds = list;

        _didInit = true;
    }
示例#18
0
 public void checkAndShowIntersitial()
 {
     if (!_config.GoogleAds.UsingAdModInterstitial)
     {
         if (_didInit && !InhouseSDK.getInstance().getIsPro())
         {
             ShowSkipVideo(null);
         }
         return;
     }
     else
     {
         if (_didInit && !InhouseSDK.getInstance().getIsPro())
         {
             AdmobManager.getInstance().ShowInterstitial();
             checkAndRequestIntersitial();
         }
     }
 }
示例#19
0
 public void checkAndRequestIntersitial()
 {
     if (!_config.GoogleAds.UsingAdModInterstitial)
     {
         return;
     }
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         int ratio = UnityEngine.Random.Range(0, 100);
         if (ratio < _config.GoogleAds.DisplayFrequencyOfInterstitial)
         {
             AdmobManager.getInstance().RequestInterstitial(_config.GoogleAds.InterstitialAdUnitID);
         }
     }
     else
     {
         Debug.Log("AdmobMgr: Dont request");
     }
 }
示例#20
0
    public void ClosePopup()
    {
        _isshowing = false;

        // increase number display
//		#warning need to fix
        InhouseSDK.getInstance().GetManager <AdServiceMgr>().IncreaseNumDisplay();

        Object[]    objs       = GameObject.FindObjectsOfType(typeof(GameObject));
        BoxCollider targetMono = null;

        foreach (GameObject obj in objs)
        {
            targetMono = obj.GetComponent <BoxCollider>();
            if (targetMono != null)
            {
                targetMono.enabled = true;
            }
        }
    }
示例#21
0
 public void HideBanner()
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         foreach (KeyValuePair <string, string> item in _config.Ads.AdsType)
         {
             if (item.Key == TAG_ADSTYPE_BANER)
             {
                 BaseAds ads = _ads [item.Value];
                 if (ads != null)
                 {
                     ads.HideBanner();
                 }
                 else
                 {
                     HDDebug.Log("AdsMgr: " + item.Key + " not supported");
                 }
             }
         }
     }
 }
示例#22
0
    public void ShowPaidAlert()
    {
        if (_didInit)
        {
            int rated = PlayerPrefs.GetInt("paid", 0);
            if (_config.PaidAlert.Enable && rated == 0)
            {
                InhouseSDK.Language content = _config.PaidAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage());
                if (content != null)
                {
                    float  delayTime = _config.PaidAlert.Second;
                    string title     = (string)content.Title;
                    string message   = (string)content.Message;
                    string ok        = (string)content.OK;
                    string cancel    = (string)content.Cancel;

                    InhouseSDK.getInstance().StartCoroutine(ShowMessageWithDelay(delayTime, title, message, ok, cancel, _config.PaidAlert.URL, PaidCall));
                }
            }
        }
    }
示例#23
0
 public bool IsBannerShowing()
 {
     if (_didInit && !InhouseSDK.getInstance().getIsPro())
     {
         foreach (KeyValuePair <string, string> item in _config.Ads.AdsType)
         {
             if (item.Key == TAG_ADSTYPE_BANER)
             {
                 BaseAds ads = _ads [item.Value];
                 if (ads != null)
                 {
                     return(ads.IsBannerShowing());
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
     }
     return(false);
 }
示例#24
0
 public void ShowRateAlertPopup()
 {
     if (_didInit)
     {
         int rated = PlayerPrefs.GetInt("rated", 0);
         if (rated == 0)
         {
             InhouseSDK.Language content = _config.RateAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage());
             if (content == null)
             {
                 content = _config.RateAlert.Languages.getLanguage("en");
             }
             if (content != null)
             {
                 string title   = content.Title;
                 string message = content.Message;
                 string ok      = content.OK;
                 string cancel  = content.Cancel;
                 InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, _config.RateAlert.URL, RateCallback);
             }
         }
     }
 }
示例#25
0
    public void ShowRateAlert()
    {
        if (_didInit)
        {
            int count_rate = PlayerPrefs.GetInt("count_rate", -1);
            int rated      = PlayerPrefs.GetInt("rated", 0);

            if (count_rate == -1)
            {
                count_rate = 1;
                PlayerPrefs.SetInt("count_rate", count_rate);
            }
            Debug.Log("Rated = " + rated);
            Debug.Log("Count rate: " + count_rate);
            Debug.Log("Config rate: " + _config.RateAlert.NumberToDisplayRatingPopup);
            if (count_rate >= _config.RateAlert.NumberToDisplayRatingPopup && rated == 0)
            {
                Debug.Log("Languate A: " + (_config.RateAlert.Languages != null).ToString());
                InhouseSDK.Language content = _config.RateAlert.Languages.getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage());
                Debug.Log("Languate B");
                if (content != null)
                {
                    string title   = content.Title;
                    string message = content.Message;
                    string ok      = content.OK;
                    string cancel  = content.Cancel;
                    InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, _config.RateAlert.URL, RateCallback);
                }
            }
            else
            {
                PlayerPrefs.SetInt("count_rate", count_rate + 1);
            }
            PlayerPrefs.Save();
            Debug.Log("Rate done");
        }
    }
示例#26
0
    void Awake()
    {
        _soundMrg = FindObjectOfType <SoundManager> ();
//		string urlPlist = "https://www.dropbox.com/s/h01v3s1kdgep8pr/config.plist?dl=1";
        InhouseSDK.getInstance().Initialize("https://www.dropbox.com/s/hu9lslj6lbz9len/config.plist?dl=1", true, typeof(AdsMgr), typeof(GameCenterMgr));
    }
示例#27
0
    IEnumerator ShowMessageWithDelay(float delay, string title, string message, string ok, string cancel, string urk, InhouseSDK.InhouseCallback callback)
    {
        yield return(new WaitForSeconds(delay));

        InhouseSDK.getInstance().ShowPopup(title, message, ok, cancel, urk, callback);
    }
示例#28
0
 public static string NLINKFILE()
 {
     return(InhouseSDK.getInstance().PLIST_ONLINE_URL);
 }
示例#29
0
 public LanguageV2 getLanguage()
 {
     return(getLanguage(InhouseSDK.getInstance().GetCurrentSystemLanguage()));
 }