Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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.GetComponent <NoteController>().mIndex = mNotesObjList.Count;

                    mNotesObjList.Add(note);
                    mNotesInfoList.Add(noteInfo);
                }
            }
        }