Exemple #1
0
    public void EquipSkin(SkinInShop skinInfoInShop)
    {
        equippedSkin = skinInfoInShop._skinInfo._skinSprite;
        PlayerPrefs.SetString(skinPref, skinInfoInShop._skinInfo._skinID.ToString());

        if (currentlyEquippedSkinButton != null)
        {
            currentlyEquippedSkinButton.interactable = true;
        }

        currentlyEquippedSkinButton = skinInfoInShop.GetComponentInChildren <Button>();
        currentlyEquippedSkinButton.interactable = false;
    }
Exemple #2
0
    private void Awake()
    {
        Instance = this;

        foreach (Transform s in skinsInShopPanelsParent)
        {
            if (s.TryGetComponent(out SkinInShop skinInShop))
            {
                skinsInShopPanels.Add(skinInShop);
            }
        }

        EquipPreviousSkin();


        SkinInShop skinEquippedPanel = Array.Find(skinsInShopPanels.ToArray(), dummyFind => dummyFind._skinInfo._skinSprite == equippedSkin);

        currentlyEquippedSkinButton = skinEquippedPanel.GetComponentInChildren <Button>();
        currentlyEquippedSkinButton.interactable = false;
    }