public JObject Notes2JSON() { NotesList notesList = new NotesList { notes = new NoteInfo[mNotesInfoList.Count] }; for (int i = 0; i < mNotesInfoList.Count; ++i) { notesList.notes[i] = mNotesInfoList[i]; } return(JObject.FromObject(notesList)); }
public void LoadNotesJSON(JToken mapMetadata) { ClearNotes(); if (mapMetadata is JObject && mapMetadata["notesList"] is JObject) { NotesList notesList = mapMetadata["notesList"].ToObject <NotesList>(); if (notesList.notes == null) { Debug.Log("No notes created!"); return; } foreach (var noteInfo in notesList.notes) { GameObject note = NoteFromInfo(noteInfo); note.GetComponentInChildren <AnchorController>().mIndex = mNotesObjList.Count; mNotesObjList.Add(note); mNotesInfoList.Add(noteInfo); } } }