PlayerPrefs数据储存
unity是一个静态类提供静态方法类
针对不同的平台的一种路径数据只有自己能解析
缺点 每次只能存一个数据 数据不能重名 重名会覆盖 键值对储存
usingUnityEngine;
usingSystem.Collections;
publicclass GameController : MonoBehaviour {
void Start() {
PlayerPrefs.SetFloat("Score",1092f);
float score = PlayerPrefs.GetFloat("Score");
Debug.Log(score );
PlayerPrefs.SetInt("Score", 111);
int sc = PlayerPrefs.GetInt("Score");
Debug.Log(sc );
}
}