利用PlayerPrefs存储中文字符串,需要稍作转换一下。代码如下:
1 2 3 4 5 6 7 8 9 |
string strcn = "如何利用PlayerPrefs存储中文"; strcn = WWW.EscapeURL(strcn); PlayerPrefs.SetString("savecn", strcn); string strouit = ""; strouit = PlayerPrefs.GetString("savecn", "Null"); strouit = WWW.UnEscapeURL(strouit); Logger.Log("测试存档中文:"+strouit); |