コード例 #1
0
    public void buttonShowRewardClicked()           //Reward Ad Button Show Clicked
    {
        Debug.Log("Button Show Reward Clicked...");
        AlertCanvas.enabled = true;

        FreestarUnityBridge.showRewardedAd("", 30, "coin", "Chocolate1", "XNydpzNLIj2pBRM8");
    }
コード例 #2
0
 public void showSmallBanner()
 {
     FreestarUnityBridge.CloseBannerAd("", FreestarConstants.BANNER_AD_SIZE_320x50);
     FreestarUnityBridge.ShowBannerAd("", FreestarConstants.BANNER_AD_SIZE_320x50, sbPos);
     sbPos++;
     sbPos %= 3;
 }
コード例 #3
0
 public void buttonRequestRewardClicked()        //Reward Ad Button Request Clicked
 {
     Debug.Log("Button Request Reward Clicked...");
     FreestarUnityBridge.setDemograpics(23, "23/11/1990", "m", "single", "Asian");
     FreestarUnityBridge.setLocation("999", "123123", "321321", latitude, longitude);
     FreestarUnityBridge.loadRewardedAd("");
 }
コード例 #4
0
 public void buttonLoadInterstitialClicked()       //Interstitial Ad Button Load Clicked
 {
     Debug.Log("Button Load Interstitial Clicked...");
     FreestarUnityBridge.setDemograpics(23, "23/11/1990", "m", "single", "Asian");
     FreestarUnityBridge.setLocation("999", "123123", "321321", latitude, longitude);
     FreestarUnityBridge.loadInterstitialAd("");
 }
コード例 #5
0
    void SetupListener()
    {
        Debug.Log("game object name: " + this.name);

        FreestarUnityBridge.setInterstitialAdListener(this);
        FreestarUnityBridge.setRewardedAdListener(this);
        FreestarUnityBridge.setBannerAdListener(this);
        listenerSetup = true;
    }
コード例 #6
0
 public void showLargeBanner()
 {
     if (lbPos == FreestarConstants.BANNER_AD_POSITION_TOP)
     {
         StartCoroutine(CloseLargeBanner(60));
     }
     FreestarUnityBridge.CloseBannerAd("", FreestarConstants.BANNER_AD_SIZE_300x250);
     FreestarUnityBridge.ShowBannerAd("", FreestarConstants.BANNER_AD_SIZE_300x250, lbPos);
     lbPos++;
     lbPos %= 3;
 }
コード例 #7
0
    public void YesClicked()
    {
        Debug.Log("Yes Clicked...");
        AlertCanvas.enabled = false;

        ButtonSetup("reward", false);

        //Parma 1 : Secret Key (Get it from Vdopia Portal : Required if server-to-server callback enabled)
        //Parma 2 : User name
        //Param 3 : Reward Name or measure
        //Param 4 : Reward Amount or quantity
        FreestarUnityBridge.showRewardedAd("", 30, "coin", "Chocolate1", "XNydpzNLIj2pBRM8");
    }
コード例 #8
0
    //closes the large banner after delay (because when it's on top, the "LB" button is covered up)
    IEnumerator CloseLargeBanner(float time)
    {
        yield return(new WaitForSeconds(time));

        FreestarUnityBridge.CloseBannerAd("", FreestarConstants.BANNER_AD_SIZE_300x250);
    }
コード例 #9
0
 public void buttonShowInterstitialClicked()     //Interstitial Ad Button Show Clicked
 {
     Debug.Log("Button Show Interstitial Clicked...");
     FreestarUnityBridge.showInterstitialAd("");
 }
コード例 #10
0
    IEnumerator Start()
    {
        Screen.fullScreen      = false;         //Disable Fullscreen App
        AlertCanvas.enabled    = false;
        GUITextMessage.enabled = false;

        string apiKey = "";

#if UNITY_IOS
        apiKey = "X4mdFv";
#endif
#if UNITY_ANDROID
        apiKey = "XqjhRR";
#endif
        FreestarUnityBridge.initWithAPIKey(apiKey);
        FreestarUnityBridge.SetAdRequestTestMode(true, "dinosaur");

        FreestarUnityBridge.setPrivacySettings(
            true, //whether GDPR applies
            null  //consent string in format defined by IAB, or null if no consent was obtained
            );

        // First, check if user has location service enabled
        if (!Input.location.isEnabledByUser)
        {
            yield break;
        }

        // Start service before querying location
        Input.location.Start();

        // Wait until service initializes
        int maxWait = 20;
        while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
        {
            yield return(new WaitForSeconds(1));

            maxWait--;
        }

        // Service didn't initialize in 20 seconds
        if (maxWait < 1)
        {
            print("Timed out");
            yield break;
        }

        // Connection has failed
        if (Input.location.status == LocationServiceStatus.Failed)
        {
            print("Unable to determine device location");
            yield break;
        }
        else
        {
            // Access granted and location value could be retrieved
            latitude  = string.Format("{0:N3}", Input.location.lastData.latitude);
            longitude = string.Format("{0:N3}", Input.location.lastData.longitude);
            print("Location: " +
                  Input.location.lastData.latitude +
                  " " + Input.location.lastData.longitude +
                  " " + Input.location.lastData.altitude +
                  " " + Input.location.lastData.horizontalAccuracy +
                  " " + Input.location.lastData.timestamp);
        }

        // Stop service if there is no need to query location updates continuously
        Input.location.Stop();
    }