码迷,mamicode.com
首页 > 其他好文 > 详细

永久化保存 (排行榜的写法list)

时间:2018-09-27 22:54:59      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:play   历史   ref   .text   ever   set   sort   reverse   nbsp   

 1  int max = PlayerPrefs.GetInt("max"), min = PlayerPrefs.GetInt("min"), cen = PlayerPrefs.GetInt("cen");
 2         3         List<int> arr = new List<int>();
 4         arr.Add(max);
 5         arr.Add(min);
 6         arr.Add(cen);
 7         arr.Add(num);
 8         arr.Sort();
 9         arr.Reverse();
10         PlayerPrefs.SetInt("max", arr[0]);
11         PlayerPrefs.SetInt("cen", arr[1]);
12         PlayerPrefs.SetInt("min", arr[2]);
13         df.text = "历史最高:" + PlayerPrefs.GetInt("max") + "\n" + "第二名:" + PlayerPrefs.GetInt("cen") + "\n" + "第三名:" + PlayerPrefs.GetInt("min");

 

永久化保存 (排行榜的写法list)

标签:play   历史   ref   .text   ever   set   sort   reverse   nbsp   

原文地址:https://www.cnblogs.com/satanj/p/9716056.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!