Пример #1
0
    public void Resume_Game()
    {
        MobileAds.Initialize("ca-app-pub-1387518596299983~7726041072");
        resumeBtn.GetComponentInChildren <Text>().text = "Loading...";
        GameObject knife       = GameObject.FindGameObjectWithTag("knife");
        KnifeWalk  knifeScript = knife.GetComponent <KnifeWalk>();

        reklamObjesi = RewardBasedVideoAd.Instance;
        AdRequest reklamIstegi = new AdRequest.Builder().Build();

        reklamObjesi.LoadAd(reklamIstegi, adsId);
        PlayerPrefs.SetInt("GameScore", knifeScript.score);
        PlayerPrefs.SetInt("foodSpeed", knifeScript.foodSpeed);
        PlayerPrefs.SetInt("GameResume", 1);

        if (reklamObjesi.IsLoaded())
        {
            reklamObjesi.Show();
            reklamObjesi.OnAdRewarded += HandleVideoReward;
        }
        else
        {
            reklamObjesi.OnAdLoaded += HandleVideoLoaded;
        }
    }
Пример #2
0
 void Start()
 {
     knife       = GameObject.FindGameObjectWithTag("knife");
     knifeScript = knife.GetComponent <KnifeWalk>();
     foodObject  = GameObject.FindGameObjectWithTag("bgScript");
     StartCoroutine(CreateFoods());
 }
Пример #3
0
 void Start()
 {
     rigid2D     = GetComponent <Rigidbody2D>();
     Knife       = GameObject.FindGameObjectWithTag("knife");
     knifeScript = Knife.GetComponent <KnifeWalk>();
 }