public override IEnumerator ReceivePayload(VisualPayload payload) { foreach (var entry in CsvField.GetEntries(payload.Data)) { string csvString = CsvField.GetValue(entry); if (string.IsNullOrEmpty(csvString)) { yield break; } var values = csvString.Split(','); NumberOfElementsTarget.SetValue(Mathf.FloorToInt(values.Length / 4f), entry); for (int i = 0; i < values.Length / 4; i++) { Entry1Target.SetValue(values[4 * i], entry); Entry2Target.SetValue(values[4 * i + 1], entry); Entry3Target.SetValue(values[4 * i + 2], entry); Entry4Target.SetValue(values[4 * i + 3], entry); var iterator = PerEntryState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } } }
protected override void OnProcessOutputSchema(MutableObject newSchema) { Entry1Target.SetValue("1", newSchema); Entry2Target.SetValue("2", newSchema); Entry3Target.SetValue("3", newSchema); NumberOfElementsTarget.SetValue(1, newSchema); Router.TransmitAllSchema(newSchema); }