Example #1
0
    void Init()
    {
        PlayMusic(genericLoop);

        adTime = adTimer;
        Vector3 bottomLeftCorner = gameCamera.ScreenToWorldPoint(new Vector3(0f, 0f, 10f));
        Vector3 upperRightCorner = gameCamera.ScreenToWorldPoint(new Vector3(gameCamera.pixelWidth, gameCamera.pixelHeight, 10f));

        screenWidthUnits   = -bottomLeftCorner.x + upperRightCorner.x;
        screenHeightUnits  = upperRightCorner.y - bottomLeftCorner.y;
        screenWidthPixels  = gameCamera.pixelWidth;
        screenHeightPixels = gameCamera.pixelHeight;
        generateDistance   = screenWidthUnits / gridWidth * gridHeight;
        labyrinthInstance.SetParams(gridWidth, gridHeight, startingGenSectors, screenWidthUnits, squarePrefab, bottomLeftCorner);
        for (int i = 0; i < startingGenSectors; i++)
        {
            labyrinthInstance.GenerateNextSector();
        }
        bannerV = new BannerView("ca-app-pub-5377701829054453/7844227328", AdSize.Banner, AdPosition.Bottom);
        AdRequest request1 = new AdRequest.Builder().Build();

        bannerV.LoadAd(request1);
        bannerV.Show();
        audioSource.mute = PlayerPrefs.GetInt("mute", 0) == 1;
        if (!audioSource.mute)
        {
            menuSoundButtonText.text = "on";
            gameSoundButton.sprite   = soundOn;
        }
        else
        {
            menuSoundButtonText.text = "off";
            gameSoundButton.sprite   = soundOff;
        }
        isPlaying = false;
    }