/// <summary> /// Gets all the DataSources in the user account. /// </summary> /// <returns>A list with all the DataSources</returns> public DataSource[] GetDataSources() { string Json = Bridge.Get("datasources"); List <Dictionary <string, object> > RawValues = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(Json); DataSource[] DataSources = new DataSource[RawValues.Count]; for (var i = 0; i < RawValues.Count; i++) { DataSources[i] = new DataSource(RawValues[i], this); } return(DataSources); }
/// <summary> /// Gets all the DataSources in the user account. /// </summary> /// <returns>A list with all the DataSources</returns> public IEnumerator GetDataSources(System.Action <DataSource[]> dataSources) { var outputMessage = ""; yield return(Extender.Instance.StartCoroutine(Bridge.Get("datasources", result => outputMessage = result))); List <ServerBridge.JsonData> RawValues = JsonUtility.FromJson <List <ServerBridge.JsonData> >(outputMessage); DataSource[] DataSources = new DataSource[RawValues.Count]; for (var i = 0; i < RawValues.Count; i++) { DataSources[i] = new DataSource(RawValues[i], this); } dataSources(DataSources); }