Question by
Spainforce · Aug 28, 2016 at 05:46 PM ·
scripting problemplayerprefs
how i save and load my coins look the script please
using UnityEngine; using System.Collections; using UnityEngine.UI;
public class Coin : MonoBehaviour { public int coinValue; public Text scoreText;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update() {
scoreText.text = coinValue.ToString();
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "coins")
{
coinValue = coinValue + 1;
Destroy(other.gameObject);
}
}
}
use playerprefs for it, i couldnt do it . i need help please,
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612091733im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
need help with code please 1 Answer
Big numbers 2 Answers
How to Save the Current that what load from playerprefs 0 Answers