private void Start()
    {
        //Find Debugger
        if (GameObject.Find("DEBUG_OUTPUT"))
        {
            debugger = GameObject.Find("DEBUG_OUTPUT").GetComponent <Text>();
        }

        //Start Google Services
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, OnAuthenticated);

        //Start Ad Service
        AdTime.Initialize();
        //Start Money Machine
        iap = GetComponent <MillionairBaby>();

        //Check for ads purchased
        if (PlayerPrefs.GetInt("noAdsPurchased") == 0)
        {
            if (iap.checkPurchase(iap.removeAds))
            {
                PlayerPrefs.SetInt("noAdsPurchased", 1);
            }
        }
    }
Ejemplo n.º 2
0
 private void Update()
 {
     if (!AdTime.lastAdSuccessful)
     {
         AdTime.AdThyme(AdTime.ADID_LOSS);
     }
 }
Ejemplo n.º 3
0
    private void Start()
    {
        currentObjective.text = objectiveLines[objectivesCompleted];
        player     = GameObject.FindGameObjectWithTag("Player");
        playerCtrl = player.GetComponent <PlayerController>();

        //Load best time if there is one
        bestTimeFloat = PlayerPrefs.GetFloat("LEVELBESTTIME" + LevelID.ToString());

        achivementOnce = false;

        if (bestTimeFloat > 0.0f)
        {
            bestTime.text = FloatToTime.convertFloatToTime(bestTimeFloat);
            //bestTime.text = (Mathf.Round(bestTimeFloat * 100f) / 100f).ToString();
        }
        else
        {
            bestTimeFloat = Mathf.Infinity;
        }
        //Check for purchase of removal of ads
        adsEnabled = true;

        if (PlayerPrefs.GetInt("noAdsPurchased") == 1)
        {
            adsEnabled = false;
        }

        if (adsEnabled)
        {
            //Start Ad Service
            AdTime.Initialize();
        }

        //DEBUGGER
        if (GameObject.Find("DEBUG_OUTPUT"))
        {
            debugger = GameObject.Find("DEBUG_OUTPUT").GetComponent <Text>();
            Debugger("Best Time: " + bestTimeFloat.ToString());
            Debugger("AD BOOL: " + PlayerPrefs.GetInt("noAdsPurchased").ToString());
        }
    }
Ejemplo n.º 4
0
    IEnumerator showAd()
    {
        yield return(new WaitForSeconds(1.5f));

        if (adsEnabled)
        {
            //Play ad every third death
            int deathCount = PlayerPrefs.GetInt("deathCount");
            if (deathCount >= 2)
            {
                AdTime.AdThyme(AdTime.ADID_LOSS);
                PlayerPrefs.SetInt("deathCount", 0);
            }
            else
            {
                PlayerPrefs.SetInt("deathCount", deathCount + 1);
            }
            Debugger(deathCount.ToString());
        }
        endScreen();
    }
Ejemplo n.º 5
0
 private void Start()
 {
     //Start Ad Service
     AdTime.Initialize();
 }