void ISerializationCallbackReceiver.OnAfterDeserialize() { if (string.IsNullOrEmpty(this.groupFiltersUON) == false) { this.groupFilters = UON.FromUON(this.groupFiltersUON) as GroupFilters; } }
/// <summary> /// Adds an element to the list. Will catch any exception in case of failure during the serialization. /// </summary> /// <param name="value"></param> public void Add(object value) { try { this.dataContainer.Add(UON.ToUON(value)); } catch (Exception ex) { InternalNGDebug.LogFileException(ex); } }
public object Get(int i) { try { return(UON.FromUON(this.dataContainer[i])); } catch (Exception ex) { InternalNGDebug.LogFileException(ex); } return(null); }
private void DrawFooter(Rect r) { r.y -= 3F; r.width = (r.width - 56F) / 2F; r.height -= 5F; if (GUI.Button(r, "Export") == true) { string path = EditorUtility.SaveFilePanel(Constants.PackageTitle, "", "profiles", "uon"); if (string.IsNullOrEmpty(path) == false) { File.WriteAllText(path, UON.ToUON(ProfilesManager.profiles)); } } r.x += r.width; if (GUI.Button(r, "Import") == true) { string path = EditorUtility.OpenFilePanel(Constants.PackageTitle, "", "uon"); if (string.IsNullOrEmpty(path) == false) { try { string uon = File.ReadAllText(path); List <Profile> importedProfiles = UON.FromUON(uon) as List <Profile>; ProfilesManager.profiles = importedProfiles; ProfilesManager.Save(); } catch (Exception ex) { Debug.LogException(ex); } } } }
void ISerializationCallbackReceiver.OnBeforeSerialize() { this.groupFiltersUON = UON.ToUON(this.groupFilters); }