コード例 #1
0
    public void ToggleToHackCard()
    {
        runnerMode = false;
        cardBattleContextHolder.SetActive(false);
        cardHackContextHolder.SetActive(true);

        string   paddedCardId = "" + card.GetCardId().ToString("000");
        string   imagePath    = "CardPrefabs/HackPlayer/HackCard" + paddedCardId;
        HackCard newHackCard  = Resources.Load <HackCard>(imagePath);

        hackCard             = newHackCard;
        cardHackImage.sprite = hackCard.GetCardImage();

        SetupSpikes(hackCard);
    }
コード例 #2
0
    public void SetupCardSample(
        HackCard newHackCard,
        Card newCard,
        Sprite topLeftSpikeImage,
        Sprite topRightSpikeImage,
        Sprite bottomLeftSpikeImage,
        Sprite bottomRightSpikeImage
        )
    {
        runnerCard.SetActive(false);
        hackerCard.SetActive(true);

        hackCard = newHackCard;
        card     = newCard;
        hackerCardImage.sprite         = hackCard.GetCardImage();
        hackerCardLeftCircuit.sprite   = card.GetLeftCircuitImage();
        hackerCardTopCircuit.sprite    = card.GetTopCircuitImage();
        hackerCardRightCircuit.sprite  = card.GetRightCircuitImage();
        hackerCardBottomCircuit.sprite = card.GetBottomCircuitImage();
        topLeftSpike.sprite            = topLeftSpikeImage;
        topRightSpike.sprite           = topRightSpikeImage;
        bottomLeftSpike.sprite         = bottomLeftSpikeImage;
        bottomRightSpike.sprite        = bottomRightSpikeImage;
    }
コード例 #3
0
    public void SetTopCard()
    {
        Image[]        imageHolders   = GetComponentsInChildren <Image>();
        AllSpikeImages allSpikeImages = FindObjectOfType <AllSpikeImages>();

        if (cards.Count == 0)
        {
            foreach (Image image in imageHolders)
            {
                image.sprite = allSpikeImages.GetEmptyImage();
            }
        }
        else
        {
            HackCard topCard = cards[0];
            foreach (Image image in imageHolders)
            {
                switch (image.name)
                {
                case "HackDeckCardBack":
                    image.sprite = allSpikeImages.GetCardBack();
                    break;

                case "LeftCircuit":
                    string color;
                    if (tempLeftCircuit != null)
                    {
                        color = tempLeftCircuit;
                    }
                    else
                    {
                        color = topCard.GetLeftCircuit();
                    }
                    Sprite currentImage = allSpikeImages.GetCircuitImageByColorAndDirection(color, "left");
                    image.sprite = currentImage;
                    break;

                case "TopCircuit":
                    if (tempTopCircuit != null)
                    {
                        color = tempTopCircuit;
                    }
                    else
                    {
                        color = topCard.GetTopCircuit();
                    }
                    currentImage = allSpikeImages.GetCircuitImageByColorAndDirection(color, "top");
                    image.sprite = currentImage;
                    break;

                case "RightCircuit":
                    if (tempRightCircuit != null)
                    {
                        color = tempRightCircuit;
                    }
                    else
                    {
                        color = topCard.GetRightCircuit();
                    }
                    currentImage = allSpikeImages.GetCircuitImageByColorAndDirection(color, "right");
                    image.sprite = currentImage;
                    break;

                case "DownCircuit":
                    if (tempBottomCircuit != null)
                    {
                        color = tempBottomCircuit;
                    }
                    else
                    {
                        color = topCard.GetBottomCircuit();
                    }
                    currentImage = allSpikeImages.GetCircuitImageByColorAndDirection(color, "bottom");
                    image.sprite = currentImage;
                    break;

                case "TopLeftSpike":
                    Spike  currentspike = topCard.GetTopLeftSpike();
                    string state        = currentspike.GetSpikeState();
                    color        = currentspike.GetSpikeColor();
                    currentImage = allSpikeImages.GetSpikebyColorCornerAndState(color, "topleft", state);
                    image.sprite = currentImage;
                    break;

                case "TopRightSpike":
                    currentspike = topCard.GetTopRightSpike();
                    state        = currentspike.GetSpikeState();
                    color        = currentspike.GetSpikeColor();
                    currentImage = allSpikeImages.GetSpikebyColorCornerAndState(color, "topright", state);
                    image.sprite = currentImage;
                    break;

                case "BottomLeftSpike":
                    currentspike = topCard.GetBottomLeftSpike();
                    state        = currentspike.GetSpikeState();
                    color        = currentspike.GetSpikeColor();
                    currentImage = allSpikeImages.GetSpikebyColorCornerAndState(color, "bottomleft", state);
                    image.sprite = currentImage;
                    break;

                case "BottomRightSpike":
                    currentspike = topCard.GetbottomRightSpike();
                    state        = currentspike.GetSpikeState();
                    color        = currentspike.GetSpikeColor();
                    currentImage = allSpikeImages.GetSpikebyColorCornerAndState(color, "bottomright", state);
                    image.sprite = currentImage;
                    break;

                case "CardImage":
                    image.sprite = topCard.GetCardImage();
                    break;
                }
            }
        }
    }