public void AddMoneyAtPosition(int money, float x, float y) { txtMoneyAdd.GetComponent <SCR_MoneyAdd>().Spawn(money.ToString(), x, y + PUNCH_TEXT_OFFSET_Y); txtMoneyAdd.GetComponent <RectTransform>().anchorMin = Vector2.zero; txtMoneyAdd.GetComponent <RectTransform>().anchorMax = Vector2.zero; txtMoneyAdd.GetComponent <Text>().alignment = TextAnchor.MiddleCenter; txtMoneyAdd.GetComponent <Text>().fontSize = 80; SCR_Profile.AddMoney(money); totalReward += money; }
public void AddMoney(int money) { txtMoneyAdd.GetComponent <SCR_MoneyAdd>().SetText(money.ToString()); txtMoneyAdd.GetComponent <RectTransform>().anchorMin = txtMoneyAddOriginalAnchorMin; txtMoneyAdd.GetComponent <RectTransform>().anchorMax = txtMoneyAddOriginalAnchorMax; txtMoneyAdd.GetComponent <RectTransform>().anchoredPosition = txtMoneyAddOriginalPosition; txtMoneyAdd.GetComponent <Text>().alignment = txtMoneyAddOriginalAlignment; txtMoneyAdd.GetComponent <Text>().fontSize = txtMoneyAddOriginalFontSize; SCR_Profile.AddMoney(money); totalReward += money; }