void OnEnable()
    {
        //Debug.Log("UniOSCCodeBasedDemo.OnEnable");

        //Just to create a OSCEventTarget isn't enough. We nedd to enable it:

        oscTarget1.Enable();

        oscTarget2.Enable();

        oscTarget3.Enable();

        oscTarget4.Enable();

        oscTarget5.Enable();


        oscDispatcher1.Enable();

        oscDispatcher2.Enable();
        //just a test to show that you can clear and add data (is overwritten with 0 and 1 at Update())
        oscDispatcher2.ClearData();
        oscDispatcher2.AppendData("TEST2");
        oscDispatcher2.AppendData("TEST2.1");

        // We want sent continuously data so start our timer to set a flag at a given interval
        // The interval is in milliseconds.
        StartSendIntervalTimer();
    }
    void OnEnable()
    {
        //Debug.Log("UniOSCCodeBasedDemo.OnEnable");

        //Just to create a OSCEventTarget isn't enough. We nedd to enable it:

        oscTarget1.Enable();

        oscTarget2.Enable();

        oscTarget3.Enable();

        oscTarget4.Enable();

        //oscTarget5.Enable();



        if (controllerToTrack == null)
        {
            controllerToTrack = this.gameObject;
        }

        //here your custom code

        //If you append data  data later you should always call this first otherwise we get more and more data appended if you toggle the enabled state of your component.
        //ClearData();


        //We append our data that we want to send with a message
        //The best place to do this step is on Enable().This approach is more flexible through the internal way UniOSC works.
        //later in the your "MySendOSCMessageTriggerMethod" you change this data with :
        //Message mode: ((OscMessage)_OSCeArg.Packet).UpdateDataAt(index,yourValue);
        //Bundle mode Mode: ((OscBundle)_OSCeArg.Packet).Messages[i]).UpdateDataAt(index,yourValue);
        //We only can append data types that are supported by the OSC specification:
        //(Int32,Int64,Single,Double,String,Byte[],OscTimeTag,Char,Color,Boolean)

        //Message mode

        controllerXPosition = controllerToTrack.transform.position.x;                   // drag
        controllerYPosition = controllerToTrack.transform.position.y;                   // drag
        controllerScale     = controllerToTrack.transform.localScale.x;                 // pinch
        controllerZRotation = controllerToTrack.transform.eulerAngles.z;                // twist
        isDragging          = 0;
        isDoubleTapped      = 0;
        isTwisting          = 0;
        isPinching          = 0;


        oscDispatcher1.AppendData(isDragging);                  // data at index [0] int isDragging
        oscDispatcher1.AppendData(controllerXPosition);         // data at index [1] float x
        oscDispatcher1.AppendData(controllerYPosition);         // data at index [2] float y
        oscDispatcher1.AppendData(isPinching);                  // data at index [3] int isPinching
        oscDispatcher1.AppendData(controllerScale);             // data at index [4] float z scale
        oscDispatcher1.AppendData(isTwisting);                  // data at index [5] int isTwisting
        oscDispatcher1.AppendData(controllerZRotation);         // data at index [6] float z rotation (euler)
        oscDispatcher1.AppendData(isDoubleTapped);              // data at index [7] int IsDoubleTapped


        //oscDispatcher1.Enable();

        //oscDispatcher2.Enable();
        ////just a test to show that you can clear and add data (is overwritten with 0 and 1 at Update())
        //oscDispatcher2.ClearData();
        //oscDispatcher2.AppendData("TEST2");
        //oscDispatcher2.AppendData("TEST2.1");

        // We want sent continously data so start our timer to set a flag at a given interval
        // The interval is in milliseconds.
        StartSendIntervalTimer();
    }