Ejemplo n.º 1
0
    void Start()
    {
        bool giveFreeGift = PlayerInfo.info.CanGiveFreeGift() && Advertisement.IsReady("rewardedVideo");

        // bool giveFreeMoney = PlayerInfo.info.CanGiveFreeMoney() && Advertisement.IsReady("rewardedVideo");

        if (giveFreeGift)
        {
            gifts     = Instantiate(giftGroup).GetComponent <GiftManager>();
            giftGroup = gifts.GetComponent <RectTransform>();
            giftGroup.SetParent(mainCanvas.GetComponent <RectTransform>(), false);
            luckyButton.gameObject.SetActive(true);
            // luckyButton.position = buttonPos1.position;
        }

        //if (giveFreeMoney)
        //{
        //    freeMoneyButton.gameObject.SetActive(true);
        //    PlayerPrefs.DeleteKey("freeMoneySum");
        //    freeMoneySum = PlayerPrefs.GetInt("freeMoneySum", 0);
        //    if (freeMoneySum == 0 || isFreeMoneyTaken)
        //    {
        //        freeMoneySum = MoneyController.RoundSumWithZeroes(Random.Range(100, maxRewardedMoneyPrize), 1);
        //        PlayerPrefs.SetInt("freeMoneySum", freeMoneySum);
        //        PlayerPrefs.Save();
        //        isFreeMoneyTaken = false;
        //    }
        //    freeMoneyText.text = freeMoneySum.ToString();
        //    if (giveFreeGift)
        //    {
        //        freeMoneyButton.position = buttonPos2.position;
        //    }
        //    else
        //    {
        //        freeMoneyButton.position = buttonPos1.position;
        //    }

        //}


        Time.timeScale = 1;
        lightening.lightMaterial.color = PlayerInfo.info.GetMainColor(lightSaturation);
        Camera.main.backgroundColor    = PlayerInfo.info.GetMainColor(backgroundSaturation);

        Transform player = Instantiate(allStoreShapesContainer.allStoreShapes[PlayerInfo.info.activePlayerShapeIndex].gameObject).GetComponent <Transform>();

        player.parent        = GetComponent <Transform>();
        player.localScale    = Vector2.one;
        player.localPosition = Vector2.zero;

        highScore.text = PlayerInfo.info.highScore.ToString();
        blur           = Camera.main.GetComponent <BlurOptimized>();


        if (MainAuidoManager.isPlayingSound)
        {
            sfxImage.sprite = sfxOn;
        }
        else
        {
            sfxImage.sprite = sfxOff;
        }

        if (MainAuidoManager.isPlayingMusic)
        {
            musicImage.sprite = musicOn;
        }
        else
        {
            musicImage.sprite = musicOff;
        }

        if (Vibration.canVibrate)
        {
            vibrationImage.sprite = vibrationOn;
        }
        else
        {
            vibrationImage.sprite = vibrationOff;
        }

        version.text = Application.version;
    }