Esempio n. 1
0
    public void addCard(GameObject details)
    {
        GameObject go   = Instantiate(PrefabDictionary.Instance().cardBase, spawnPoint.position, Quaternion.identity, transform.transform);
        BaseCard   card = go.GetComponent <BaseCard>();

        card.character  = character;
        card.hiddenCard = getDefaultHiddenStatus();
        card.loadCardDetails(details);

        cards.Add(card);

        organizeCards();
    }
    private void displayPlayerCardCollection()
    {
        foreach (GameObject cardGO in PlayerCardCollection.Instance().cardCollection)
        {
            GameObject go = Instantiate(PrefabDictionary.Instance().cardBase, Vector3.zero, Quaternion.Euler(collectionHolder.transform.rotation.eulerAngles + new Vector3(90, 0, 0)), collectionHolder.transform);
            go.AddComponent <PreadventureCardSelector>();
            BaseCard card = go.GetComponent <BaseCard>();
            //Instantiate(PrefabDictionary.Instance().inDeckOverlay, go.transform);
            card.loadCardDetails(cardGO);

            collectionCards.Add(go);
        }
    }
    private void displayCollectionSection(List <GameObject> cardPrefabs, bool includedInDeck)
    {
        int cardIndex = collectionCards.Count;

        foreach (GameObject cardGO in cardPrefabs)
        {
            GameObject go   = Instantiate(PrefabDictionary.Instance().cardBase, Vector3.zero, Quaternion.Euler(90, 0, 0), collectionHolder.transform.transform);
            BaseCard   card = go.GetComponent <BaseCard>();
            if (includedInDeck)
            {
                //Instantiate(PrefabDictionary.Instance().inDeckOverlay, go.transform);
            }
            card.loadCardDetails(cardGO);

            collectionCards.Add(go);
        }
    }
Esempio n. 4
0
 public void previewCard(GameObject card)
 {
     currentPreviewedCard = card;
     sideboardPreviewCard.loadCardDetails(currentPreviewedCard);
 }
    public void previewCard(GameObject card)
    {
        currentPreviewedCard = card;
        cardProgressPreviewCard.loadCardDetails(currentPreviewedCard);
        CardProgress prog   = PlayerCardProgress.Instance().cards[currentPreviewedCard.GetComponent <CardDetails>().cardName];
        int          maxExp = 0;

        switch (prog.progress)
        {
        case CardProgression.Unlearned: {
            progressMeterBackground.sprite = untrainedBackground;
            maxExp = PlayerCardProgress.Instance().untrainedExpCap;
            break;
        }

        case CardProgression.Trained: {
            progressMeterBackground.sprite = trainedBackground;
            maxExp = PlayerCardProgress.Instance().trainedExpCap;
            break;
        }

        case CardProgression.Adept: {
            progressMeterBackground.sprite = adeptBackground;
            maxExp = PlayerCardProgress.Instance().adpetExpCap;
            break;
        }

        case CardProgression.Proficient: {
            progressMeterBackground.sprite = proficientBackground;
            maxExp = PlayerCardProgress.Instance().proficientExpCap;
            break;
        }

        case CardProgression.Mastered: {
            progressMeterBackground.sprite = masteredBackground;
            maxExp = PlayerCardProgress.Instance().masteredExpCap;
            break;
        }

        case CardProgression.Perfected: {
            progressMeterBackground.sprite = perfectedBackground;
            cardProgress.value             = 1.0f;
            zeroPercText.gameObject.SetActive(false);
            twentyfivePercText.gameObject.SetActive(false);
            fiftyPercText.gameObject.SetActive(false);
            seventyfivePercText.gameObject.SetActive(false);
            hundredPercText.gameObject.SetActive(false);
            break;
        }
        }

        progressMeterTitleText.text = prog.progress.ToString();
        if (prog.progress == CardProgression.Perfected)
        {
            cardProgress.value = 1;
        }
        else
        {
            cardProgress.value = ((float)prog.expPoints) / ((float)maxExp);
        }
        zeroPercText.text        = "0";
        twentyfivePercText.text  = (maxExp / 4).ToString();
        fiftyPercText.text       = (maxExp / 2).ToString();
        seventyfivePercText.text = ((3 * maxExp) / 4).ToString();
        hundredPercText.text     = (maxExp).ToString();

        if ((!SubSceneNode.getDict().ContainsKey("Battle") || !SubSceneNode.getDict()["Battle"].isActive()) &&
            prog.progress != CardProgression.Perfected &&
            prog.expPoints >= maxExp)
        {
            rankUpButton.interactable = true;
        }
        else
        {
            rankUpButton.interactable = false;
        }
    }