public static void FromJson(this SO_PopupConfigData_Container so, PopupConfigContainer data) { so.popupConfigDataContainer.Clear(); //myDict.Clear(); data.popupConfigData.ForEach(x => { var soref = SO_PopupConfigData.CreateInstance <SO_PopupConfigData>(); soref = new SO_PopupConfigData(x); AssetDatabase.CreateAsset(soref, String.Format("Assets/SO/Entries/{0}.asset", x.popUpId.ToString())); so.popupConfigDataContainer.Add(soref); }); }
public static string ToJson(this SO_PopupConfigData_Container so) { string temp = ""; PopupConfigContainer wPopupConfigContainer = new PopupConfigContainer(); //var configs = wPopupConfigContainer.popupConfigData; so.popupConfigDataContainer.ForEach(x => { wPopupConfigContainer.popupConfigData.Add(new PopupConfigData(x)); }); temp = JsonUtility.ToJson(wPopupConfigContainer); return(temp); }
public static void LoadFromJsonTest(this SO_PopupConfigData_Container so) { PopupConfigContainer test = JsonUtility.FromJson <PopupConfigContainer>(so.jsonInput); so.FromJson(test); }