void Start () { charactersMenu = transform.parent.parent.GetComponent<CharactersMenu>(); originalPosition = transform.localPosition; originalRotation = transform.localRotation; originalScale = transform.localScale; scaleChanging = transform.localScale.x; productId = "toy_" + name; bProduct = BillingManager.bm.getProduct(productId); checkBought(false); }
public void setRarity(Text text) { Rarity rarity = CharacterManager.cm.character(name).rarity; if (charactersMenu == null) { charactersMenu = transform.parent.parent.GetComponent<CharactersMenu>(); } if (rarity == Rarity.Common) { text.text = "Common"; text.color = charactersMenu.colorsPerRarity[0]; } else if (rarity == Rarity.Rare) { text.text = "Rare"; text.color = charactersMenu.colorsPerRarity[1]; } else if (rarity == Rarity.Epic) { text.text = "Epic"; text.color = charactersMenu.colorsPerRarity[2]; } else if (rarity == Rarity.Legendary) { text.text = "Legendary"; text.color = charactersMenu.colorsPerRarity[3]; } }