internal static Track ToTrack(JSONObject jsonObj) { Track track = new Track(); List <HapticEffect> effectList = new List <HapticEffect>(); var effects = jsonObj.GetValueOrDefault("effects", new JSONArray()); foreach (var effect in effects) { effectList.Add(HapticEffect.ToEffect(effect.Value.AsObject)); } track.Effects = effectList.ToArray(); return(track); }
internal static Track ToTrack(JsonObject jsonObj) { Track track = new Track(); List <HapticEffect> effectList = new List <HapticEffect>(); var effects = jsonObj.GetNamedArray("effects", new JsonArray()); foreach (var effect in effects) { effectList.Add(HapticEffect.ToEffect(effect.GetObject())); } track.Effects = effectList.ToArray(); return(track); }