void Awake()
    {
        if (_instance == null)
        {
                        #if UNITY_IOS || UNITY_IPHONE
            Advertisement.Initialize("99257");
                        #else
            Advertisement.Initialize("95899");
                        #endif

            DontDestroyOnLoad(gameObject);
            //RequestInterstitial ();

//			if (FB.IsInitialized) {
//				Debug.Log ("activate in start");
//				FB.ActivateApp();
//			} else {
//
//				Debug.Log ("init fb");
//				//Handle FB.Init
//				FB.Init( () => {
//
//					Debug.Log ("init activate in start");
//					FB.ActivateApp();
//				});
//			}
            _instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
Exemple #2
0
 void Start()
 {
     isPaused    = false;
     gameManager = FindObjectOfType <GameManager>();
     sampleAds   = FindObjectOfType <GoogleMobileAdsDemoScript>();
     ball        = FindObjectOfType <BallControl>();
     score       = FindObjectOfType <ScoreManager>();
     endGamePanel.SetActive(false);
     soundState = PlayerPrefs.GetInt("soundOption");
     musicState = PlayerPrefs.GetInt("musicOption");
     if (soundState == 0)
     {
         soundToggle.GetComponent <Toggle>().isOn = true;
     }
     else if (soundState == 1)
     {
         soundToggle.GetComponent <Toggle>().isOn = false;
     }
     if (musicState == 0)
     {
         musicToggle.GetComponent <Toggle>().isOn = true;
     }
     else if (musicState == 1)
     {
         musicToggle.GetComponent <Toggle>().isOn = false;
     }
 }
Exemple #3
0
    public void Start()
    {
        if (googleMobileAdsDemoScript == null)
        {
            googleMobileAdsDemoScript = this;
        }
        else
        {
            Destroy(this);
            return;
        }

#if UNITY_ANDROID
        string appId = "ca-app-pub-9419165164875030~5142885353";
#elif UNITY_IPHONE
        string appId = "ca-app-pub-3940256099942544~1458002511";
#else
        string appId = "unexpected_platform";
#endif

        // Initialize the Google Mobile Ads SDK.
        MobileAds.Initialize(appId);

        this.RequestBanner();
    }
Exemple #4
0
 // Token: 0x06000450 RID: 1104 RVA: 0x00013028 File Offset: 0x00011428
 public void HandleAdLeftApplication(object sender, EventArgs args)
 {
     if (GoogleMobileAdsDemoScript.BannerChangedEvent != null)
     {
         GoogleMobileAdsDemoScript.BannerChangedEvent(false);
     }
     MonoBehaviour.print("HandleAdLeftApplication event received");
 }
Exemple #5
0
 void Awake()
 {
     if (intance == null)
     {
         intance = this;
     }
     ggAdmobs = GameObject.Find("GGAmobs").GetComponent <GoogleMobileAdsDemoScript> ();
 }
Exemple #6
0
 // Token: 0x0600045B RID: 1115 RVA: 0x00013108 File Offset: 0x00011508
 public void HandleRewardBasedVideoClosed(object sender, EventArgs args)
 {
     Ads_Script.Reward_Video_Shown = true;
     if (GoogleMobileAdsDemoScript.VideoDone != null)
     {
         GoogleMobileAdsDemoScript.VideoDone(false);
     }
     MonoBehaviour.print("HandleRewardBasedVideoClosed event received");
 }
Exemple #7
0
 // Token: 0x0600044F RID: 1103 RVA: 0x00012FFC File Offset: 0x000113FC
 public void HandleAdClosed2(object sender, EventArgs args)
 {
     Ads_Script.current.isBannerVisible2 = false;
     if (GoogleMobileAdsDemoScript.BannerChangedEvent != null)
     {
         GoogleMobileAdsDemoScript.BannerChangedEvent(false);
     }
     MonoBehaviour.print("HandleAdClosed event received");
 }
Exemple #8
0
 // Token: 0x0600044C RID: 1100 RVA: 0x00012F98 File Offset: 0x00011398
 public void HandleAdOpened2(object sender, EventArgs args)
 {
     if (GoogleMobileAdsDemoScript.BannerChangedEvent != null)
     {
         GoogleMobileAdsDemoScript.BannerChangedEvent(true);
     }
     Ads_Script.current.isBannerVisible2 = true;
     MonoBehaviour.print("HandleAdOpened event received");
 }
Exemple #9
0
    // Token: 0x0600045C RID: 1116 RVA: 0x00013130 File Offset: 0x00011530
    public void HandleRewardBasedVideoRewarded(object sender, Reward args)
    {
        if (GoogleMobileAdsDemoScript.VideoDone != null)
        {
            GoogleMobileAdsDemoScript.VideoDone(true);
        }
        Debug.Log("Rewarded..");
        string type = args.Type;

        MonoBehaviour.print("HandleRewardBasedVideoRewarded event received for " + args.Amount.ToString() + " " + type);
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
Exemple #11
0
 // Token: 0x06000455 RID: 1109 RVA: 0x0001308A File Offset: 0x0001148A
 public void HandleInterstitialClosed(object sender, EventArgs args)
 {
     MonoBehaviour.print("HandleInterstitialClosed event received");
     if (Ads_Script.rewardInterstitalAd)
     {
         Ads_Script.Interstitial_Shown = false;
         if (GoogleMobileAdsDemoScript.VideoDone != null)
         {
             GoogleMobileAdsDemoScript.VideoDone(true);
         }
     }
     Ads_Script.Interstitial_Shown = true;
 }
Exemple #12
0
    void Awake()
    {
        ggAdmobs = GameObject.Find("GGAmobs").GetComponent <GoogleMobileAdsDemoScript> ();
        ggAdmobs.startSceneManager = this;

        if (MultiResolution.device == "ipad")
        {
            canzas1.localScale = new Vector3(0.75f, 0.75f, 1);
            canzas2.localScale = new Vector3(0.75f, 0.75f, 1);
        }
        else
        {
            canzas1.localScale = new Vector3(1, 1, 1);
            canzas2.localScale = new Vector3(0.75f, 0.75f, 1);
        }

        if (instance != null)
        {
            instance = this;
        }

        DisplayGold();
        DisplayDiamond();
        CheckSetting();

        ChooseCharManager.instance.ReadSave();
        QuestManager.Intance.UpdateDisplayUI();
        isShopScene = false;

        // Chua lam tat app thi tra ze

        /*if (SaveManager.instance.state.isFirstOpenApp) {
         *      dailyRewardObj.SetActive (true);
         *      SaveManager.instance.state.isFirstOpenApp = false;
         *      SaveManager.instance.Save ();
         * } else
         *      dailyRewardObj.SetActive (false);*/

        DisplayClaimRewardDaily();

        if (FadeAni.isRunMapToChooseChar)
        {
            if (FadeAni.isRunMapToHome == false)
            {
                ChooseCharManager.instance.AniChangeScene();
            }
            fadeAni.OffFade();
            fadeAni.stateFade            = FadeAni.State.Hide;
            FadeAni.isRunMapToChooseChar = false;
        }
    }
Exemple #13
0
    // Use this for initialization
    void Start()
    {
        if (PlayerPrefs.GetInt("Luncher") == 0)
        {
            PlayerPrefs.SetInt("Luncher", 0);
        }

        if (PlayerPrefs.GetString("ServerAdsData").Length <= 0)
        {
            string s = "<NJ_DB_FULL>0#3#ca-app-pub-3451337100490595/2432646017#200</NJ_DB_FULL>\n<URL>https://play.google.com/store/apps/details?id=com.app.autocallrecorder#https://play.google.com/store/apps/details?id=com.app.ninja#https://www.facebook.com/profile.php?id=100020476457047</URL>\n <NJ_GAME>0#1#ca-app-pub-3451337100490595/7876544384#1</NJ_GAME>\n<NJ_FAIL>0#3#ca-app-pub-3451337100490595/2432646017#4</NJ_FAIL>\n<NJ_PAUSE>0#3#ca-app-pub-3451337100490595/2432646017#2</NJ_PAUSE>\n<NJ_DASHBOARD>0#1#ca-app-pub-3451337100490595/7876544384#0</NJ_DASHBOAD>";
            PlayerPrefs.SetString("ServerAdsData", s);
        }

        PlayerPrefs.SetInt("FailOccurLocal", 0);
        PlayerPrefs.SetInt("PauseOccurLocal", 0);

        string url = "http://quantum4you.com/piqvalue.php?val=WALL_JUMP";
        WWW    www = new WWW(url);

        StartCoroutine(WaitForRequest(www));

        googleads = gameObject.AddComponent <GoogleMobileAdsDemoScript> ();

        if (PlayerPrefs.GetString("ServerAdsData").Length > 10)
        {
            AdsDataCalculation(PlayerPrefs.GetString("ServerAdsData"));
        }
        installationDays = int.Parse(GetDaysPassed());

        if (MainAdStartday == 0 || (MainAdStartday >= installationDays))
        {
            adsCalling(MainAdType, MainAdId);
        }

        if (Luncher == false && (LuncherAdStartday == 0 || (LuncherAdStartday >= Test.installationDays)) && LuncherFullDisplay(LuncherAdOccurance))
        {
            adsCalling(LuncherAdType, LuncherAdId);
            StartCoroutine(AdsFullRequest());
        }
        if (Luncher == false)
        {
            Luncher = true;
        }
    }
Exemple #14
0
    // Use this for initialization
    void Start()
    {
        SaveManager.instance.state.firstInGame = false;
        SaveManager.instance.Save();
        ggAdmob  = GameObject.Find("GGAmobs").GetComponent <GoogleMobileAdsDemoScript> ();
        ggAdmobs = ggAdmob;

        isViewRewardAds  = 0;
        minutesLastClick = 0;
        minutesWait      = 300;
        ggAdmobs.RequestBanner();
        ggAdmobs.RequestInterstitial();
        ggAdmobs.RequestRewardBasedVideo();
        if (!isTestGame)
        {
            StartCoroutine(Wait(Random.Range(3f, 5f)));
        }
        else
        {
            StartCoroutine(Wait(0));
        }
    }
 void Start()
 {
     Instance = this;
     InvokeRepeating("RequestInterstitial", 0, 120);
     RequestBanner();
 }