unity3d数据存取

来源:互联网 发布:淘宝抢鞋软件 编辑:程序博客网 时间:2024/05/23 18:55

PlayerPrefs  

Class Functions

SetInt

Sets the value of the preference identified by key.

GetInt

Returns the value corresponding to key in the preference file if it exists.

SetFloat

Sets the value of the preference identified by key.

GetFloat

Returns the value corresponding to key in the preference file if it exists.

SetString

Sets the value of the preference identified by key.

GetString

Returns the value corresponding to key in the preference file if it exists.

HasKey

Returns true if key exists in the preferences.

DeleteKey

Removes key and its corresponding value from the preferences.

DeleteAll

Removes all keys and values from the preferences. Use with caution.

Save

Writes all modified preferences to disk.




官方英文文档:
http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

Unity 中保存或读取数组的方法
http://www.cocoachina.com/gamedev/gameengine/2011/0214/2651.html