/// <summary> /// Set up shirt for card objects. /// </summary> /// <param name="shirtObject">Shirt image component.</param> public void SetShirtForCardsOnStart(Image shirtObject) { CurrentShirt = shirtObject.gameObject; VisualiseElement cardScript = CurrentShirt.GetComponent <VisualiseElement>(); //if this is being called from Start, set the cards properly ShirtName = CurrentShirt.name; PlayerPrefs.SetString(CURRENT_SHIRT, ShirtName); ActionWithAnimationForObjects(ShirtsImage, ShirtName, 10f); foreach (var item in CLComponent.CardsArray) { item.BackgroundImage.sprite = shirtObject.sprite; item.UpdateCardImg(); } }
/// <summary> /// Set up shirt for card objects. /// </summary> /// <param name="shirtObject">Shirt image component.</param> public void SetShirtForCards(Image shirtObject) { CurrentShirt = shirtObject.gameObject; VisualiseElement cardScript = CurrentShirt.GetComponent <VisualiseElement>(); //if the Player has unlocked the card, let them select it if (cardScript.isUnlocked == true) { ShirtName = CurrentShirt.name; PlayerPrefs.SetString(CURRENT_SHIRT, ShirtName); ActionWithAnimationForObjects(ShirtsImage, ShirtName, 10f); foreach (var item in CLComponent.CardsArray) { item.BackgroundImage.sprite = shirtObject.sprite; item.UpdateCardImg(); } } else { //tooltip for level up to unlock } }