Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     generationProgressText.gameObject.SetActive(true);
     npnProgressText.gameObject.SetActive(false);
     
     PlayerStats.SetTutorialStepCompleted(TutorialStep.GoToCollection);
     // pageSwiper will force a pageChanged, which will complete SwipeCollection, so SetActive should be above pageSwiper filling
     tutorialSwipeCollectionPanel.SetActive(PlayerStats.GetShowTutorialStep(TutorialStep.SwipeCollection));
     pageSwiper = pageHolder.GetComponent<PageSwiper>();
     singleNPNPageSwiper = singleNPNPageHolder.GetComponent<PageSwiper>();
     singleCardImage = singleCard.GetComponent<Image>();
     favoriteButtonImage = favoriteButton.GetComponent<Image>();
     generationDropdown.ClearOptions();
     for (int i = 1; i <= CardFactory.numberOfGenerations; i++)
     {
         if (PlayerStats.IsGenerationUnlocked(i))
         {
             generationDropdown.options.Add(new TMP_Dropdown.OptionData("Gen " + i));
         }
     }
     generationDropdown.value = GameManager.SelectedGeneration - 1;
     // if GameManager.SelectedGeneration != 1, then line above will have triggered OnGenerationChanged
     if (GameManager.SelectedGeneration == 1)
     {
         OnGenerationChanged(generationDropdown);
     }
 }
Beispiel #2
0
 public void OnPointerClick(PossibleCard ownedCard, Image image)
 {
     if (singleNPNPageHolder.activeSelf)
     {
         // from NPN to singleCard
         PlayerStats.SetTutorialStepCompleted(TutorialStep.ZoomCard);
         tutorialZoomCardPanel.SetActive(false);
         singleCardImage.sprite = image.sprite;
         currentSingle = ownedCard;
         SetFavoriteButtonColor(ownedCard.id.Equals(PlayerStats.GetFavorite(ownedCard.nationalPokedexNumber)));
         favoriteButton.SetActive(true);
         tutorialMakeFavoritePanel.SetActive(PlayerStats.GetShowTutorialStep(TutorialStep.MakeFavorite));
         singleNPNPageHolder.SetActive(false);
         npnProgressText.gameObject.SetActive(false);
         singleCard.SetActive(true);
     }
     else
     {
         // for people clicking before swiping
         PlayerStats.SetTutorialStepCompleted(TutorialStep.SwipeCollection);
         tutorialSwipeCollectionPanel.SetActive(false);
         // for people with the 8 in 15000 chance AND clicking before swiping
         tutorialTurnInDoublesPanel.SetActive(false);
         // from generation to NPN
         SingleNPNStart(ownedCard.nationalPokedexNumber);
     }
 }
Beispiel #3
0
 public void OnFavoriteClick()
 {
     PlayerStats.SetTutorialStepCompleted(TutorialStep.MakeFavorite);
     tutorialMakeFavoritePanel.SetActive(false);
     SetFavoriteButtonColor(PlayerStats.ToggleFavorite(currentSingle));
     // yes, now smallImage contains a largeImage, but it's already loaded so I don't care
     smallImages[currentSingle.nationalPokedexNumber].sprite = singleCardImage.sprite;
 }
Beispiel #4
0
    public void OnDoublesClick()
    {
        PlayerStats.SetTutorialStepCompleted(TutorialStep.TurnInDoubles);
        tutorialTurnInDoublesPanel.SetActive(false);
        // small chance AND trade doubles before click or swipe
        PlayerStats.SetTutorialStepCompleted(TutorialStep.SwipeCollection);
        tutorialSwipeCollectionPanel.SetActive(false);
        doublesText.text = string.Format("You have\r\n{0} double card(s)\r\nof this generation.\r\n\r\nDo you want to\r\ntrade them for\r\nClick - Power?", numberOfDoubles);

        finalClickPowerText.text = string.Format("Your Click-Power\r\nwill go from\r\n{0:0.00} to {1:0.00}",
            PlayerStats.GetClickPower() / (float)GameManager.coinFactor,
            (PlayerStats.GetClickPower() + numberOfDoubles) / (float)GameManager.coinFactor);
        turnInDoublesPanel.SetActive(true);
    }
Beispiel #5
0
 public void OnPageChanged()
 {
     // pageSwiper pages start at 1, we start at 0
     int currentPage = pageSwiper.currentPage - 1;
     int newMax = Mathf.Min(pageSwiper.totalPages, currentPage + 2);
     for (int pageNumber = maxPageFilled; pageNumber < newMax; pageNumber++)
     {
         FillPage(pageNumber, pages[pageNumber]);
     }
     maxPageFilled = Mathf.Max(maxPageFilled, newMax);
     if (currentPage > 0)
     {
         PlayerStats.SetTutorialStepCompleted(TutorialStep.SwipeCollection);
         tutorialSwipeCollectionPanel.SetActive(false);
     }
 }