public JObject AudioCuesToJSON() { AudioCueList audioCueList = new AudioCueList(); audioCueList.audioCues = new AudioCueInfo[audioCueInfoList.Count]; for (int i = 0; i < audioCueInfoList.Count; i++) { audioCueList.audioCues[i] = audioCueInfoList[i]; } return(JObject.FromObject(audioCueList)); }
public void LoadAudioCuesJSON(JToken mapMetadata) { ClearAudioCues(); if (mapMetadata is JObject && mapMetadata[AUDIO_CUE_LIST_NAME] is JObject) { AudioCueList audioCueList = mapMetadata[AUDIO_CUE_LIST_NAME].ToObject <AudioCueList>(); if (audioCueList.audioCues == null) { Debug.Log("No audio cues dropped."); return; } foreach (AudioCueInfo audioCueInfo in audioCueList.audioCues) { audioCueInfoList.Add(audioCueInfo); GameObject audioCue = CreateAudioCueFromInfo(audioCueInfo); audioCueObjList.Add(audioCue); } } }