public void OnDisable()
        {
            //Debug.Log("OnDisable");

            EditorApplication.playmodeStateChanged -= _HandleOnPlayModeChanged;

            if (OSCConnection == null)
            {
                return;
            }

            oscTarget1.Dispose();
            oscTarget1 = null;

            oscTarget2.Dispose();
            oscTarget2 = null;

            oscTarget3.Dispose();
            oscTarget3 = null;

            oscTarget4.Dispose();
            oscTarget4 = null;

            oscTarget5.Dispose();
            oscTarget5 = null;

            oscSender1.Dispose();
            oscSender1 = null;
        }
        public void OnEnable()
        {
            Debug.Log("OnEnable");

            // We need to monitor the playmodeStateChanged event to update the references to OSCConnections (only necessary when we use the explicitConnection feature)
            //and force a new connection setup through disable/enable on our OSCEventTargets otherwise we have to re-open our Editor
            EditorApplication.playmodeStateChanged += _HandleOnPlayModeChanged;

            //When we use a OSCConnection in the constructor of a OSCEventTarget instance we need to also store the InstanceID to be able to re-reference it on playmodeStateChanges!
            OSCConnection = FindObjectOfType <UniOSCConnection>() as UniOSCConnection;
            if (OSCConnection != null)
            {
                OSCConnectionID = OSCConnection.GetInstanceID();
                Debug.Log("Used Connection:" + OSCConnection.name);
            }
            else
            {
                Debug.LogWarning("No OSC Connection is found in scene or is enabled!");
                return;
            }


            //Here we show the different possibilities to create a OSCEventTarget from code:

            //When we only specify a port we listen to all OSCmessages on that port (We assume that there is a OSCConnection with that listening port in our scene)
            oscTarget1 = new UniOSCEventTargetCBImplementation(OSCPort);
            oscTarget1.OSCMessageReceived += OnOSCMessageReceived1;
            oscTarget1.Enable();



            //This implies that we use the explicitConnection mode. (With responding to all OSCmessages)
            oscTarget2 = new UniOSCEventTargetCBImplementation(OSCConnection);
            oscTarget2.OSCMessageReceived += OnOSCMessageReceived2;
            oscTarget2.Enable();

            //We listen to a special OSCAddress regardless of the port.
            oscTarget3 = new UniOSCEventTargetCBImplementation(OSCAddress);
            oscTarget3.OSCMessageReceived += OnOSCMessageReceived3;
            oscTarget3.Enable();

            //The standard : respond to a given OSCAddress on a given port
            oscTarget4 = new UniOSCEventTargetCBImplementation(OSCAddress, OSCPort);
            oscTarget4.OSCMessageReceived += OnOSCMessageReceived4;
            oscTarget4.Enable();

            //This version has the advantage that we are not bound to a special port. If the connection changes the port we still respond to the OSCMessage
            oscTarget5 = new UniOSCEventTargetCBImplementation(OSCAddress, OSCConnection);
            oscTarget5.OSCMessageReceived += OnOSCMessageReceived5;
            oscTarget5.Enable();

            oscSender1 = new UniOSCEventDispatcherCBSimple(OSCOutAddress, OSCConnection);
            // oscSender1 = new UniOSCEventDispatcherCBSimple("Test0", "127.0.0.1", 9003);
            oscSender1.AppendData("TestData");
            oscSender1.AppendData(12345);
            oscSender1.Enable();

            // oscSender1.ClearData();
            //Just some test

            /*
             * oscSender1.AppendData(678);
             */
            /*
             * oscSender1.oscOutAddress = "/2/XXXXXX";
             * oscSender1.oscOutAddress = "/2/XXXXXX2";
             * oscSender1.Disable();
             * oscSender1.oscOutAddress = "/2/XXXXXX3";
             * oscSender1.oscOutPort = 9001;
             * oscSender1.Enable();
             * oscSender1.oscOutIPAddress = "127.0.0.1";
             * oscSender1.useExplicitConnection = false;
             * oscSender1.oscOutIPAddress = "127.0.0.1";
             * oscSender1.oscOutIPAddress = "192.168.178.21";
             * oscSender1.oscOutPort = 9000;
             * */
        }