public static void SaveData(object dataObj) { var dataType = dataObj.GetType(); SaveRoot saveRoot = new SaveRoot(); saveRoot._SaveKey = dataType.Name; saveRoot._ChildNode = GetNodesForSave(dataObj); SaveRoot(saveRoot); }
public static void SaveRoot(SaveRoot root) { string saveStr = ""; foreach (var child in root._ChildNode) { saveStr += DataPackSave.SaveSplitChars[0] + child.ToSaveString(1); } saveStr = saveStr.Substring(1); Debug.Log("SaveRoot:" + saveStr); LocalSave.Save(root._SaveKey, saveStr); }