示例#1
0
 public void UpdateCurrentSelectedButton(UIShopButton selectedButton)
 {
     foreach (UIShopButton button in virusesButtons)
     {
         button.isSelected = button == selectedButton;
     }
 }
示例#2
0
    public void UpdateSelectImage(UIShopButton thisButton)
    {
        newSkinSeledtedSound.CheckIsAudioEnabledAndPlay();

        foreach (UIShopButton button in virusesButtons)
        {
            if (button != thisButton)
            {
                button.selectIcon.enabled = false;
            }

            else
            {
                shopButtonIcon.sprite = button.snakeSprites[0];

                if (button.isSecretSkin)
                {
                    shopButtonIcon.sprite = button.secretVirusSkin[2];
                }

                button.selectIcon.enabled = true;
            }

            button.LockRefresh();
        }
    }
示例#3
0
    public void SetLastSelectedSkin()
    {
        foreach (UIShopButton button in virusesButtons)
        {
            if (button.skinNumber == PersistentData.VirusSkin.CurrentSelectedSkin.Get())
            {
                UIShopButton currentButton = button;

                if (!button.isBought)
                {
                    currentButton = virusesButtons[0];
                }

                currentButton.selectIcon.enabled = true;
                shopButtonIcon.sprite            = currentButton.snakeSprites[0];

                if (currentButton.isSecretSkin)
                {
                    shopButtonIcon.sprite = currentButton.secretVirusSkin[2];
                }

                currentButton.SetSprites();
                newSkinSeledtedSound.Stop();
                preview.ShowSkinOnPreviewTable(currentButton);
            }

            else
            {
                button.selectIcon.enabled = false;
            }
        }
    }
示例#4
0
    public void UpdateSprites(UIShopButton button)
    {
        headSpriteRenderer.sprite = button.snakeSprites[0];

        foreach (SpriteRenderer body in bodiesSprites)
        {
            body.sprite = button.snakeSprites[1];
        }

        if (TemporaryData.IsSecretSkinSelected)
        {
            headSpriteRenderer.color = SecretSkin.Colors[0];

            int i = 0;

            foreach (SpriteRenderer tail in bodiesSprites)
            {
                tail.color = SecretSkin.Colors[i++];
            }
        }

        else
        {
            Color defaultColor = new Color(1, 1, 1);
            headSpriteRenderer.color = defaultColor;

            foreach (SpriteRenderer tail in bodiesSprites)
            {
                tail.color = defaultColor;
            }
        }
    }
示例#5
0
    public void ShowSkinOnPreviewTable(UIShopButton newSkin)
    {
        currentSelectedSkin = newSkin;

        head.sprite = newSkin.snakeSprites[0];

        @lock.sprite = lockIcon;

        foreach (Image body in bodies)
        {
            body.sprite = newSkin.snakeSprites[1];
            body.color  = new Color(1, 1, 1, 1);
        }

        head.color = new Color(1, 1, 1, 1);

        if (!newSkin.isBought)
        {
            overlay.enabled = true;

            purchaseButton.SetActive(true);
            maxLevel.SetActive(false);

            if (newSkin.isSecretSkin)
            {
                //@lock.enabled = true;
                //cost.gameObject.SetActive(false);
                //@lock.sprite = qIcon;

                for (int i = 0; i < bodies.Length; i++)
                {
                    bodies[i].color = SecretSkin.Colors[i];
                }

                head.color = SecretSkin.Colors[0];
            }

            //else if (newSkin.LvlSkin && !newSkin.prevSkinLvl.isBought)
            //{
            //    @lock.enabled = true;
            //    cost.gameObject.SetActive(false);
            //}

            else
            {
                @lock.enabled = false;
            }

            cost.gameObject.SetActive(true);

            cost.text = newSkin.cost.ToString();
        }

        else
        {
            if (newSkin.isSecretSkin)
            {
                for (int i = 0; i < bodies.Length; i++)
                {
                    bodies[i].color = SecretSkin.Colors[i];
                }

                head.color = SecretSkin.Colors[0];
            }

            overlay.enabled = false;
            cost.gameObject.SetActive(false);
            @lock.enabled = false;

            purchaseButton.SetActive(false);

            maxLevel.SetActive(true);
            maxLevel.GetComponentInChildren <Text>().text = "Max LVL: " + UIFinalScorePanel.LevelNames[newSkin.skinMaxLevelInt] + " (" + newSkin.skinMaxLevelInt.ToString() + ")";
        }
    }
示例#6
0
 public static void SetSnakeSkin(UIShopButton button)
 {
     PlayerHeadSprite = button.snakeSprites[0];
     PlayerBodySprite = button.snakeSprites[1];
     PersistentData.VirusSkin.CurrentSelectedSkin.Set(button.skinNumber);
 }