Example #1
0
        public void Load()
        {
            Type fieldsType = this.GetType();

            FieldInfo[] fields = fieldsType.GetFields(BindingFlags.Public | BindingFlags.Instance);
            ListValue = StorageData.LoadData(ID);
            if (ListValue == null)
            {
                ListValue = new BaseModel();
                for (int i = 0; i < fields.Length; i++)
                {
                    //Debug.Log(fields[i].Name + " : " + fields[i].GetValue(this) + " : " + fields[i].ReflectedType + " : " + fields[i].FieldType);
                    AddValueToList(fields[i]);
                }
            }
            else
            {
                LoadFromList();
            }
        }
Example #2
0
 public void Save()
 {
     SaveOnList();
     StorageData.SaveData(ListValue, ID);
 }