coin collecting to buy item c# urgent

hi guys , i need your help please… i want to make or collect coin… and when im lose or die on my game, thats coin is multiply and i can buy item from coin… how that logic? and how can i can create like that?

i have this script for my coin collect, but i dont know how can i save thats coin and multiply…

	public int coin;
	public TextMesh coinText;
	
	void OnTriggerEnter2D(Collider other){
		if(other.gameObject.tag =="coin"){
			Destroy(other.gameObject);
			coin += 1;
		}
	}
	
	void Update(){
		coinText.text = coin;
	}

i really want to save my coin and sometimes when i have many coin, i can buy some item using thats coin?

thankyou :slight_smile:

You can store (and load) the amount of coins collected in the Playerprefs.