Beispiel #1
0
    public void UpdateVisual()
    {
        tick.enabled = IsBought();
        if (IsBought())
        {
            priceText.gameObject.SetActive(false);
        }
        else
        {
            priceText.text        = "" + price;
            priceText_shadow.text = "" + price;
        }
        halo.enabled = false;

        if (!prerequisite || prerequisite.IsBought())
        {
            GetComponent <SpriteRenderer>().color = Color.white;
        }
        else
        {
            Color gray = Color.gray;
            gray.a = 0.5f;
            GetComponent <SpriteRenderer>().color = gray;
        }
    }
Beispiel #2
0
    void UpdateMessage()
    {
        ClickToBuyText.enabled     = false;
        NotEnoughCoinsText.enabled = false;
        OwnedText.enabled          = false;
        BuyRainbowText.enabled     = false;

        if (selected.IsBought())
        {
            OwnedText.enabled = true;
        }
        else if (selected.prerequisite && !selected.prerequisite.IsBought())
        {
            BuyRainbowText.enabled = true;
        }
        else if (selected.price > PlayerData.Instance.Coins)
        {
            NotEnoughCoinsText.enabled = true;
        }
        else
        {
            ClickToBuyText.enabled = true;
        }
    }