public void Receive(string sendName, ListReceiveCallback listReceiver, bool asynchronous = false) { if (!sendNameListReceiverDict.ContainsKey(sendName)) { LibPD.Subscribe(sendName); sendNameListReceiverDict[sendName] = new List <PureDataListReceiver>(); } sendNameListReceiverDict[sendName].Add(new PureDataListReceiver(sendName, listReceiver, asynchronous, pureData)); }
public void Release(ListReceiveCallback listCallback) { foreach (List <PureDataListReceiver> listReceivers in sendNameListReceiverDict.Values) { for (int i = listReceivers.Count - 1; i >= 0; i--) { if (listReceivers[i].listReceiver == listCallback) { Release(listReceivers[i]); } } } }
/// <summary> /// Unsubscribes a delegate so that it stops receiving lists from Pure Data. /// </summary> /// <param name="listReceiver">The subscribed delegate that will stop receiving lists.</param> public static void Release(ListReceiveCallback listReceiver) { instance.communicator.Release(listReceiver); }
/// <summary> /// Subscribes a delegate so that it receives lists from all <c>[send <paramref name="sendName"/>]</c> in Pure Data. /// </summary> /// <param name="sendName">The name of the sender from which the lists will be received.</param> /// <param name="listReceiver">The delegate that will receive the lists.</param> /// <param name="asynchronous">If true, the lists will be received as soon as they are sent by Pure Data, otherwise they will be received on the next Unity Update, FixedUpdate or LateUpdate.</param> public static void Receive(string sendName, ListReceiveCallback listReceiver, bool asynchronous = false) { instance.communicator.Receive(sendName, listReceiver, asynchronous); }
public PureDataListReceiver(string sendName, ListReceiveCallback listReceiver, bool asynchronous, PureData pureData) : base(sendName, asynchronous, pureData) { this.listReceiver = listReceiver; }