Esempio n. 1
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (gameMaster.gamePaused == false && gameMaster.gameOn == true)
        {
            if (collision.gameObject.tag == "Bowl")
            {
                audioSource.volume = soundsController.soundEffectsVolume;
                audioSource.PlayOneShot(catchClip);

                if (isDiamond == true)
                {
                    gameMaster.AddDiamonds(1);
                }
                else if (isDirty == true)
                {
                    gameMaster.DamagePlayer(1);
                }
                else
                {
                    gameMaster.AddScore(1);
                }
                Destroy(gameObject);
            }
        }
    }
Esempio n. 2
0
    private void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("The ad was successfully shown.");
            switch (reward)
            {
            case "diamond":
                Debug.Log("Add diamonds");
                gameMaster.AddDiamonds(1);
                break;

            case "dubbleWaterdrops":
                Debug.Log("Dubble score");
                gameMaster.SaveWaterdrops();
                gameMaster.AddScore(gameMaster.score);
                break;
            }
            break;

        case ShowResult.Skipped:
            Debug.Log("The ad was skipped before reaching the end.");
            break;

        case ShowResult.Failed:
            Debug.LogError("The ad failed to be shown.");
            break;
        }
    }