コード例 #1
0
    public void add10Coins()
    {
        FlurryEventsManager.SendEvent("collect_prize");

        for (int i = 0; i < 10; i++)
        {
            GameObject _coin      = (GameObject)Instantiate(coin, Camera.main.ScreenToWorldPoint(giftButton.transform.position), Quaternion.identity);
            Coin       coinScript = _coin.GetComponent <Coin> ();
            coinScript.MoveToEnd();
        }
        //Savee the current system time as a string in the player prefs class
        _giftNextDate = DateTime.UtcNow;
        DefsGame.BTN_GIFT_HIDE_DELAY = DefsGame.BTN_GIFT_HIDE_DELAY_ARR [DefsGame.BTN_GIFT_HIDE_DELAY_COUNTER];
        if (DefsGame.BTN_GIFT_HIDE_DELAY_COUNTER < DefsGame.BTN_GIFT_HIDE_DELAY_ARR.Length - 1)
        {
            ++DefsGame.BTN_GIFT_HIDE_DELAY_COUNTER;
            PlayerPrefs.SetInt("BTN_GIFT_HIDE_DELAY_COUNTER", DefsGame.BTN_GIFT_HIDE_DELAY_COUNTER);
        }
        _giftNextDate = _giftNextDate.AddMinutes(DefsGame.BTN_GIFT_HIDE_DELAY);
        PlayerPrefs.SetString("dateGiftClicked", _giftNextDate.ToBinary().ToString());
        UIManager.HideUiElement("BtnGift");
        //timeText.enabled = true;
        //giftButton.enabled = false;
        _isWaitGiftTime = true;
        //giftButton.DisableButtonClicks();
        D.Log("Disable Button Clicks");
    }
コード例 #2
0
ファイル: Gift.cs プロジェクト: Soulghai/EndlessDrift
    void IsGiftAvailable()
    {
        if (_isWaitGiftTime)
        {
            DateTime _currentDate = DateTime.UtcNow;
            TimeSpan _difference  = _giftNextDate.Subtract(_currentDate);
            if (_difference.TotalSeconds <= 0f)
            {
                _isWaitGiftTime = false;
                GlobalEvents <OnGiftAvailable> .Call(new OnGiftAvailable { isAvailable = true });

                FlurryEventsManager.SendEvent("collect_prize_impression");
            }
//			else {
//				string _minutes = _difference.Minutes.ToString ();
//				if (_difference.Minutes < 10) {
//					_minutes = "0" + _minutes;
//				}
//				string _seconds = _difference.Seconds.ToString ();
//				if (_difference.Seconds < 10) {
//					_seconds = "0" + _seconds;
//				}
//				timeText.text = _minutes + ":" + _seconds;
//			}
        }
    }
コード例 #3
0
 void Update()
 {
     if (_isWaitGiftTime)
     {
         DateTime _currentDate = System.DateTime.UtcNow;
         TimeSpan _difference  = _giftNextDate.Subtract(_currentDate);
         if ((_difference.TotalSeconds <= 0f) && (DefsGame.currentScreen == DefsGame.SCREEN_MENU))
         {
             _isWaitGiftTime = false;
             UIManager.ShowUiElement("BtnGift");
             FlurryEventsManager.SendEvent("collect_prize_impression");
             D.Log("Enable Button Clicks");
         }
         else
         {
             string _minutes = _difference.Minutes.ToString();
             if (_difference.Minutes < 10)
             {
                 _minutes = "0" + _minutes;
             }
             string _seconds = _difference.Seconds.ToString();
             if (_difference.Seconds < 10)
             {
                 _seconds = "0" + _seconds;
             }
             timeText.text = _minutes + ":" + _seconds;
         }
     }
 }
コード例 #4
0
    private void UpdateTmer()
    {
        if (_isWaitGiftTime)
        {
            var _currentDate = DateTime.UtcNow;
            var _difference  = _giftNextDate.Subtract(_currentDate);
            if (_difference.TotalSeconds <= 0f)
            {
                _isWaitGiftTime = false;
                GlobalEvents <OnGiftAvailable> .Call(new OnGiftAvailable { IsAvailable = true });

                FlurryEventsManager.SendEvent("collect_prize_impression");
            }
            else
            {
                string _minutes = _difference.Minutes.ToString();
                if (_difference.Minutes < 10)
                {
                    _minutes = "0" + _minutes;
                }
                string _seconds = _difference.Seconds.ToString();
                if (_difference.Seconds < 10)
                {
                    _seconds = "0" + _seconds;
                }
                timeText.text = _minutes + ":" + _seconds;
            }
        }
    }
コード例 #5
0
    private void GetReward(OnGiveReward e)
    {
        if (_isWaitReward)
        {
            _isWaitReward = false;
            if (e.isAvailable)
            {
                _state        = 2;
                _isNextLevel  = true;
                IsGameOver    = false;
                _isReviveUsed = true;
//				_bubbleField.Hide();

                ReviveClose();
                Defs.PlaySound(_sndGrab);

                FlurryEventsManager.SendEvent("RV_revive_complete");
            }
            else
            {
                ReviveClose();
                _state = 6;
            }
        }
    }
コード例 #6
0
    public void hideButtons()
    {
        if (_isButtonHiden)
        {
            return;
        }

        _isButtonHiden = true;
        FlurryEventsManager.SendEndEvent("start_screen_length");
        //UIManager.HideUiElement ("MainMenu");
        UIManager.HideUiElement("elementBestScore");
        //UIManager.HideUiElement ("elementCoins");
        UIManager.HideUiElement("BtnSkins");
        UIManager.HideUiElement("BtnGift");
        UIManager.HideUiElement("BtnVideoAds");
        UIManager.HideUiElement("BtnAchievements");
        UIManager.HideUiElement("BtnMoreGames");
        UIManager.HideUiElement("BtnSound");
        UIManager.HideUiElement("BtnRate");
        UIManager.HideUiElement("BtnLeaderboard");
        UIManager.HideUiElement("BtnShare");
        UIManager.HideUiElement("BtnSound");
        UIManager.HideUiElement("BtnPlus");
        UIManager.HideUiElement("BtnGameServices");

        UIManager.HideUiElement("BtnHaveNewSkin");
    }
コード例 #7
0
    public void Show()
    {
        FlurryEventsManager.SendStartEvent("candy_shop_length");

        DefsGame.CurrentScreen = DefsGame.SCREEN_SKINS;
        DefsGame.IsCanPlay     = false;
        ChooseColorForButtons();
        ShowButtons();
    }
コード例 #8
0
    public void Hide()
    {
        FlurryEventsManager.SendEndEvent("candy_shop_length");

        DefsGame.CurrentScreen = DefsGame.SCREEN_MENU;
        DefsGame.IsCanPlay     = true;
        ChooseColorForButtons();
        HideButtons();
    }
コード例 #9
0
    public void add10Coins()
    {
        FlurryEventsManager.SendEvent("collect_prize");
        TakeAGift(10);

        ResetTimer();

        D.Log("Disable Button Clicks");
    }
コード例 #10
0
 public void Rate()
 {
     UIManager.HideUiElement("ScreenRate");
     UIManager.HideUiElement("ScreenRateBtnRate");
     UIManager.HideUiElement("ScreenRateBtnBack");
     Defs.PlaySound(_sndGrab);
     Defs.Rate.RateUs();
     FlurryEventsManager.SendEvent("rate_us_impression", "revive_screen");
     EndCurrentGame();
 }
コード例 #11
0
    public void ShareClose()
    {
        UIManager.HideUiElement("ScreenShare");
        UIManager.HideUiElement("ScreenShareBtnShare");
        UIManager.HideUiElement("ScreenShareBtnBack");
        Defs.PlaySound(_sndClose);
        EndCurrentGame();

        FlurryEventsManager.SendEvent("high_score_home");
    }
コード例 #12
0
    public void Hide()
    {
        FlurryEventsManager.SendEndEvent("iap_shop_length");

        DefsGame.CurrentScreen = DefsGame.SCREEN_MENU;
        DefsGame.isCanPlay     = true;
        HideButtons();

        FlurryEventsManager.SendEvent("iap_shop_home", PrevScreenName);
    }
コード例 #13
0
    public void ReviveClose()
    {
        UIManager.HideUiElement("ScreenRevive");
        UIManager.HideUiElement("ScreenReviveBtnRevive");
        UIManager.HideUiElement("ScreenReviveBtnBack");
        Defs.PlaySound(_sndClose);
        EndCurrentGame();

        FlurryEventsManager.SendEvent("RV_revive_home");
    }
コード例 #14
0
    public void Show(string prevScreenName)
    {
        PrevScreenName = prevScreenName;
        FlurryEventsManager.SendStartEvent("iap_shop_length");
        FlurryEventsManager.SendEvent("iap_shop", PrevScreenName);

        DefsGame.CurrentScreen = DefsGame.SCREEN_IAPS;
        DefsGame.isCanPlay     = false;
        ShowButtons();
    }
コード例 #15
0
    public void showButtons()
    {
        _isButtonHiden = false;

        GameEvents.Send(ShowBannerAds);

        FlurryEventsManager.SendStartEvent("start_screen_length");

        //UIManager.ShowUiElement ("MainMenu");
        UIManager.ShowUiElement("elementBestScore");
        UIManager.ShowUiElement("elementCoins");
        UIManager.ShowUiElement("BtnSkins");
        FlurryEventsManager.SendEvent("candy_shop_impression");
        if (!_isWaitGiftTime)
        {
            UIManager.ShowUiElement("BtnGift");
            FlurryEventsManager.SendEvent("collect_prize_impression");
        }
        if (_isShowBtnViveoAds)
        {
            UIManager.ShowUiElement("BtnVideoAds");
            FlurryEventsManager.SendEvent("RV_strawberries_impression", "start_screen");
        }
        UIManager.ShowUiElement("BtnMoreGames");
        UIManager.ShowUiElement("BtnSound");
        UIManager.ShowUiElement("BtnRate");
        FlurryEventsManager.SendEvent("rate_us_impression", "start_screen");
        UIManager.ShowUiElement("BtnLeaderboard");
        UIManager.ShowUiElement("BtnAchievements");
#if UNITY_ANDROID || UNITY_EDITOR
        UIManager.ShowUiElement("BtnGameServices");
#endif
        UIManager.ShowUiElement("BtnMoreGames");
        UIManager.ShowUiElement("BtnShare");
        UIManager.ShowUiElement("BtnPlus");
        FlurryEventsManager.SendEvent("iap_shop_impression");
        UIManager.HideUiElement("scrMenuWowSlider");

        if (DefsGame.screenSkins)
        {
            if (DefsGame.screenSkins.CheckAvailableSkinBool())
            {
                UIManager.ShowUiElement("BtnHaveNewSkin");
            }
            else
            {
                UIManager.HideUiElement("BtnHaveNewSkin");
            }
        }

        _isBtnSettingsClicked = false;
    }
コード例 #16
0
 private void IsVideoAdsAvailable(bool flag)
 {
     _isShowBtnViveoAds = flag;
     if (flag)
     {
         if (DefsGame.CurrentScreen == DefsGame.SCREEN_IAPS)
         {
             UIManager.ShowUiElement("ScreenCoinsBtnVideo");
             FlurryEventsManager.SendEvent("RV_strawberries_impression", "shop");
         }
     }
     else
     {
         UIManager.HideUiElement("ScreenCoinsBtnVideo");
     }
 }
コード例 #17
0
 void IsVideoAdsAvailable(bool _flag)
 {
     _isShowBtnViveoAds = _flag;
     if (_flag)
     {
         if (DefsGame.currentScreen == DefsGame.SCREEN_MENU)
         {
             UIManager.ShowUiElement("BtnVideoAds");
             FlurryEventsManager.SendEvent("RV_strawberries_impression", "start_screen");
         }
     }
     else
     {
         UIManager.HideUiElement("BtnVideoAds");
     }
 }
コード例 #18
0
ファイル: ScreenCoins.cs プロジェクト: Soulghai/EndlessDrift
 private void IsRewardedVideoAvailable(OnRewardedAvailable e)
 {
     isShowBtnViveoAds = e.isAvailable;
     if (isShowBtnViveoAds)
     {
         if (DefsGame.CurrentScreen == DefsGame.SCREEN_IAPS)
         {
             UIManager.ShowUiElement("ScreenCoinsBtnVideo");
             FlurryEventsManager.SendEvent("RV_strawberries_impression", "shop");
         }
     }
     else
     {
         UIManager.HideUiElement("ScreenCoinsBtnVideo");
     }
 }
コード例 #19
0
ファイル: ScreenMenu.cs プロジェクト: Soulghai/EndlessDrift
 private void IsRewardedVideoAvailable(OnRewardedAvailable e)
 {
     _isShowBtnViveoAds = e.isAvailable;
     if (_isShowBtnViveoAds)
     {
         if (DefsGame.CurrentScreen == DefsGame.SCREEN_MENU)
         {
             UIManager.ShowUiElement("BtnVideoAds");
             FlurryEventsManager.SendEvent("RV_strawberries_impression", "start_screen");
         }
     }
     else
     {
         UIManager.HideUiElement("BtnVideoAds");
     }
 }
コード例 #20
0
 public void Share()
 {
     UIManager.HideUiElement("ScreenShare");
     UIManager.HideUiElement("ScreenShareBtnShare");
     UIManager.HideUiElement("ScreenShareBtnBack");
     if (SystemInfo.deviceModel.Contains("iPad"))
     {
         Defs.ShareVoxel.ShareClick();
     }
     else
     {
         Defs.Share.ShareClick();
     }
     FlurryEventsManager.SendEvent("high_score_share");
     Defs.PlaySound(_sndGrab);
     EndCurrentGame();
 }
コード例 #21
0
 public void ShowButtons()
 {
     UIManager.ShowUiElement("ScreenCoinsBtnBack");
     UIManager.ShowUiElement("BtnTier1");
     UIManager.ShowUiElement("BtnTier2");
     if (_isShowBtnViveoAds)
     {
         UIManager.ShowUiElement("ScreenCoinsBtnVideo");
         FlurryEventsManager.SendEvent("RV_strawberries_impression", "shop");
     }
     if (DefsGame.noAds < 1)
     {
         UIManager.ShowUiElement("ScreenCoinsBtnNoAds");
     }
             #if UNITY_IPHONE
     UIManager.ShowUiElement("ScreenCoinsBtnRestore");
             #endif
 }
コード例 #22
0
    void SetSkin(int _id)
    {
        FlurryEventsManager.SendEvent("candy_purchase_<" + _id.ToString() + ">");

        if (_id == DefsGame.CurrentFaceId)
        {
            return;
        }

        if (DefsGame.FaceAvailable [_id] == 1)
        {
            DefsGame.CurrentFaceId = _id;
            PlayerPrefs.SetInt("currentFaceID", DefsGame.CurrentFaceId);
            DefsGame.CarSimulator.Car.SetNewSkin(_id);
        }
        else if (DefsGame.CoinsCount >= DefsGame.FacePrice [_id - 1])
        {
            GameEvents.Send(OnAddCoinsVisual, -DefsGame.FacePrice [_id - 1]);
            DefsGame.FaceAvailable [_id] = 1;
            DefsGame.CurrentFaceId       = _id;
            PlayerPrefs.SetInt("currentFaceID", DefsGame.CurrentFaceId);
            PlayerPrefs.SetInt("faceAvailable_" + _id.ToString(), 1);
            DefsGame.CarSimulator.Car.SetNewSkin(_id);

            ++DefsGame.QUEST_CHARACTERS_Counter;
            PlayerPrefs.SetInt("QUEST_CHARACTERS_Counter", DefsGame.QUEST_CHARACTERS_Counter);

            //DefsGame.gameServices.ReportProgressWithGlobalID (DefsGame.gameServices.ACHIEVEMENT_NEW_SKIN, 1);

            //DefsGame.gameServices.ReportProgressWithGlobalID (DefsGame.gameServices.ACHIEVEMENT_COLLECTION, DefsGame.QUEST_CHARACTERS_Counter);

            ChooseColorForButtons();

            FlurryEventsManager.SendEvent("candy_purchase_completed_<" + _id.ToString() + ">");
        }
        else
        {
            HideButtons();
            FlurryEventsManager.SendEndEvent("candy_shop_length");

            DefsGame.ScreenCoins.Show("candy_shop");
        }
    }
コード例 #23
0
ファイル: ScreenMenu.cs プロジェクト: Soulghai/EndlessDrift
 private void GetReward(OnGiveReward e)
 {
     if (_isWaitReward)
     {
         _isWaitReward = false;
         if (e.isAvailable)
         {
             for (int i = 0; i < 25; i++)
             {
                 GameObject _coin = (GameObject)Instantiate(coin,
                                                            Camera.main.ScreenToWorldPoint(videoAdsButton.transform.position),
                                                            Quaternion.identity);
                 Coin coinScript = _coin.GetComponent <Coin>();
                 coinScript.MoveToEnd();
             }
             FlurryEventsManager.SendEvent("RV_strawberries_complete", "start_screen", true, 25);
         }
     }
 }
コード例 #24
0
    void OnGameplayStart()
    {
        if (IsGameOver)
        {
            return;
        }

        ++DefsGame.QUEST_THROW_Counter;

        if (DefsGame.GameplayCounter == 1)
        {
            _points.ShowAnimation();
        }
        if (_state == 1)
        {
            DefsGame.CurrentScreen = DefsGame.SCREEN_GAME;
            _points.ResetCounter();
            UIManager.ShowUiElement("scrMenuWowSlider");
            _state = 2;
            FlurryEventsManager.SendStartEvent("attempt_length");
        }

        //isHint = false;
    }
コード例 #25
0
 public void OnMoreAppsClicked()
 {
     //PublishingService.Instance.ShowAppShelf();
     FlurryEventsManager.SendEvent("more_games");
 }
コード例 #26
0
ファイル: ScreenMenu.cs プロジェクト: Soulghai/EndlessDrift
 public void OnVideoAdsClicked()
 {
     FlurryEventsManager.SendEvent("RV_strawberries", "start_screen");
     MyAds.ShowRewardedAds();
     _isWaitReward = true;
 }
コード例 #27
0
 public void Revive()
 {
     FlurryEventsManager.SendEvent("RV_revive");
     MyAds.ShowRewardedAds();
     _isWaitReward = true;
 }
コード例 #28
0
ファイル: ScreenCoins.cs プロジェクト: Soulghai/EndlessDrift
 public void BtnTier3()
 {
     FlurryEventsManager.SendEvent("RV_strawberries", "shop");
     MyAds.ShowRewardedAds();
     _isWaitReward = true;
 }
コード例 #29
0
 public void BtnSkinsClick()
 {
     FlurryEventsManager.SendEvent("candy_shop");
     hideButtons();
     Defs.PlaySound(sndBtnClick, 1f);
 }
コード例 #30
0
    private void SetSkin(int _id)
    {
        FlurryEventsManager.SendEvent("candy_purchase_<" + _id + ">");

        if (_id == DefsGame.CurrentFaceId)
        {
            return;
        }

        if (DefsGame.FaceAvailable[_id] == 1)
        {
            DefsGame.CurrentFaceId = _id;
            PlayerPrefs.SetInt("currentFaceID", DefsGame.CurrentFaceId);
            DefsGame.Ball.SetNewSkin(_id);
        }
        else if (DefsGame.CoinsCount >= DefsGame.FacePrice[_id - 1] || _id == 1 || _id == 2)
        {
            if (_id == 1)
            {
                if (DefsGame.FaceAvailable[_id] == 0)
                {
                    Application.OpenURL("https://twitter.com/umbrellafun");
                    FacebookMark.SetActive(false);
                }
            }
            else if (_id == 2)
            {
                if (DefsGame.FaceAvailable[_id] == 0)
                {
                    Application.OpenURL("https://www.facebook.com/umbrellafun/");
                    TwitterMark.SetActive(false);
                }
            }
            else
            {
                GameEvents.Send(OnAddCoinsVisual, -DefsGame.FacePrice[_id - 1]);
            }


            DefsGame.FaceAvailable[_id] = 1;
            DefsGame.CurrentFaceId      = _id;
            PlayerPrefs.SetInt("currentFaceID", DefsGame.CurrentFaceId);
            PlayerPrefs.SetInt("faceAvailable_" + _id, 1);
            DefsGame.Ball.SetNewSkin(_id);

            ++DefsGame.QUEST_CHARACTERS_Counter;
            PlayerPrefs.SetInt("QUEST_CHARACTERS_Counter", DefsGame.QUEST_CHARACTERS_Counter);

            //DefsGame.gameServices.ReportProgressWithGlobalID (DefsGame.gameServices.ACHIEVEMENT_NEW_SKIN, 1);

            //DefsGame.gameServices.ReportProgressWithGlobalID (DefsGame.gameServices.ACHIEVEMENT_COLLECTION, DefsGame.QUEST_CHARACTERS_Counter);

            ChooseColorForButtons();

            FlurryEventsManager.SendEvent("candy_purchase_completed_<" + _id + ">");
        }
        else
        {
            HideButtons();
            FlurryEventsManager.SendEndEvent("candy_shop_length");

            DefsGame.screenCoins.Show("candy_shop");
        }
    }