Пример #1
0
 public override void OnRemoveConnection(NodePort port)
 {
     if (port.fieldName == "Receiver")
     {
         Receiver = null;
     }
 }
Пример #2
0
 public override void OnCreateConnection(NodePort from, NodePort to)
 {
     if (to.fieldName == "Receiver")
     {
         Receiver = GetInputPort("Receiver").GetInputValue <OSC.Receiver>();
     }
 }
Пример #3
0
    public void Bind(OSC.Receiver receiver, string address)
    {
        Receiver     = receiver;
        this.address = address;
        OSC.ChannelIn[] channels = receiver.GetComponents <OSC.ChannelIn>();
        bool            found    = false;

        foreach (OSC.ChannelIn channel2 in channels)
        {
            if (channel2.address == address)
            {
                channel = channel2;
                found   = true;
                break;
            }
        }
        if (!found)
        {
            if (channel == null || channel.gameObject != receiver.gameObject)
            {
                channel = receiver.gameObject.AddComponent <OSC.ChannelIn>();
            }
            channel.address = this.address;
        }
        channel.receiver = receiver;
    }
Пример #4
0
    public void Bind(GameObject go, bool force = false)
    {
        if (force || (go != null && (go != gameObject)))
        {
            //initialized = false;
            gameObject = go;
            name       = "OSC ";

            Connection  = gameObject.GetComponent <OSC.Connection>();
            Sender      = gameObject.GetComponent <OSC.Sender>();
            Receiver    = gameObject.GetComponent <OSC.Receiver>();
            initialized = true;
        }
    }
Пример #5
0
 public void Link()
 {
     Receiver = GetInputPort("Receiver").GetInputValue <OSC.Receiver>();
 }