Exemple #1
0
 void OnGUI()
 {
     if (GUILayout.Button("<size=50>获取存档</size>"))
     {
         m_StringSeting = RecordUtil.Get("setting");
         //m_Setting = JsonUtility.FromJson<Setting> (RecordUtil.Get ("setting"));
     }
     if (!string.IsNullOrEmpty(m_StringSeting))
     {
         GUILayout.Label(string.Format("<size=50> {0} </size>", m_StringSeting));
     }
     if (!string.IsNullOrEmpty(m_StringSeting))
     {
         SettArray set = JsonUtility.FromJson <SettArray>(m_StringSeting);
         GUILayout.Label(string.Format("<size=50>成员数量:{0},第一个数据{1}{2},第二个数据{3}{4}/size>",
                                       set.setList.Count, set.setList[0].intValue, set.setList[0].stringValue, set.setList[1].intValue, set.setList[1].stringValue));
     }
     if (GUILayout.Button("<size=50>显示第二条设置数据</size>"))
     {
         m_Setting2 = RecordUtil.Get("setting2");
     }
     if (!string.IsNullOrEmpty(m_Setting2))
     {
         GUILayout.Label(string.Format("<size=50> {0}</size>", m_Setting2));
     }
     if (GUILayout.Button("<size=50>删除setting存档</size>"))
     {
         RecordUtil.Delete("setting");
     }
 }
Exemple #2
0
 void OnGUI()
 {
     if (GUILayout.Button("<size=50>获取存档</size>"))
     {
         m_Setting = JsonUtility.FromJson <Setting> (RecordUtil.Get("setting"));
     }
     if (m_Setting != null)
     {
         GUILayout.Label(string.Format("<size=50> {0},{1} </size>", m_Setting.intValue, m_Setting.stringValue));
     }
 }