public void addUB() { UB++; PlayerPrefs.SetInt("UB", PlayerPrefs.GetInt("UB") + 1); textUB.text = UB.ToString(); imageUB.sprite = fUB; }
// Start is called before the first frame update void Start() { HB = PlayerPrefs.GetInt("HB"); SB = PlayerPrefs.GetInt("SB"); UB = PlayerPrefs.GetInt("UB"); if (HB > 0) { imageHB.sprite = fHB; } if (SB > 0) { imageSB.sprite = fSB; } if (UB > 0) { imageUB.sprite = fUB; } textHB.text = HB.ToString(); textSB.text = SB.ToString(); textUB.text = UB.ToString(); }
public void useUB() { if (UB > 0) { player.addUnhitEffect(); UB -= 1; PlayerPrefs.SetInt("UB", PlayerPrefs.GetInt("UB") - 1); } textUB.text = UB.ToString(); if (UB == 0) { imageUB.sprite = eUB; } }