示例#1
0
    void Update()
    {
        // First change DMX array values (DMX Port, value [0..255]));
        // Then send it away.
        // Pick the current color of the light in the scene and send it to real LEDs via Artnet

        if (softwareLight1.color != prevLed_1_Color)
        {
            // 1 RGB LED needs 3 DMX addresses for each channel
            DMXData[port_led_1_master] = (byte)(255);
            DMXData[port_led_1_r]      = (byte)(softwareLight1.color.r * 255);
            DMXData[port_led_1_g]      = (byte)(softwareLight1.color.g * 255);
            DMXData[port_led_1_b]      = (byte)(softwareLight1.color.b * 255);

            // see color also on a gameobject in scene
            softwareLight1_debug.GetComponent <Renderer>().material.color = softwareLight1.color;
            prevLed_1_Color = softwareLight1.color;
        }

        if (shaker.color != prevShaker_Value)
        {
            DMXData[port_shaker] = (byte)(shaker.color.a * 255);

            // see color also on a gameobject in scene
            shaker_debug.GetComponent <Renderer>().material.color = shaker.color;
            prevShaker_Value = shaker.color;
        }


        ArtEngine.SendDMX(0, DMXData, DMXData.Length);
    }
    void Update()
    {
        // First change DMX array values (DMX Port, value [0..255]));
        // Then send it away.
        // Pick the current color of the light in the scene and send it to real LEDs via Artnet

        if (softwareLight_white.color != prevLed_white_Color)
        {
            DMXData[port_led_white] = (byte)(softwareLight_white.color.r * 255);


            // see color also on a gameobject in scene
            softwareLight_white_debug.GetComponent <Renderer>().material.color = softwareLight_white.color;
            prevLed_white_Color = softwareLight_white.color;
        }


        if (softwareLight_red.color != prevLed_red_Color)
        {
            DMXData[port_led_red] = (byte)(softwareLight_red.color.r * 255);

            // see color also on a gameobject in scene
            softwareLight_red_debug.GetComponent <Renderer>().material.color = softwareLight_red.color;
            prevLed_red_Color = softwareLight_red.color;
        }

        if (softwareLight_camera.color != prevLed_camera_Color)
        {
            DMXData[port_led_camera] = (byte)(softwareLight_camera.color.r * 255);

            // see color also on a gameobject in scene
            softwareLight_camera_debug.GetComponent <Renderer>().material.color = softwareLight_camera.color;
            prevLed_camera_Color = softwareLight_camera.color;
        }


        ArtEngine.SendDMX(0, DMXData, DMXData.Length);
    }
示例#3
0
 void sendDmxData()
 {
     ArtEngine.SendDMX(0, DMXData, DMXData.Length);
 }
示例#4
0
 // Update is called once per frame
 void Update()
 {
     _artNet.SendDMX(_dmxData);
 }
    void Update()
    {
        // First change DMX array values (DMX Port, value [0..255]));
        // Then send it away.
        // Pick the current color of the light in the scene and send it to real LEDs via Artnet

        if (color_skypanel1 != prevLed_skypanel1_Color)
        {
            DMXData[port_led_skypanel1] = (byte)(color_skypanel1.r * masterfader_skypanel1_ui.value * 255);

            // see color also on an UI element in scene
            softwareLight_skypanel1_gui.GetComponent <Image>().color = new Color(
                color_skypanel1.r,
                color_skypanel1.r,
                color_skypanel1.r,
                masterfader_skypanel1_ui.value);
            prevLed_skypanel1_Color = color_skypanel1;
        }


        if (color_skypanel2 != prevLed_skypanel2_Color)
        {
            DMXData[port_led_skypanel2] = (byte)(color_skypanel2.r * masterfader_skypanel2_ui.value * 255);

            // see color also on an UI element in scene
            softwareLight_skypanel2_gui.GetComponent <Image>().color = new Color(
                color_skypanel2.r,
                color_skypanel2.r,
                color_skypanel2.r,
                masterfader_skypanel2_ui.value);

            prevLed_skypanel2_Color = color_skypanel2;
        }

        if (color_stripe != prevLed_stripe_Color)
        {
            DMXData[port_led_stripe] = (byte)(color_stripe.r * masterfader_stripe_ui.value * 255);

            // see color also on an UI element in scene
            softwareLight_stripe_gui.GetComponent <Image>().color = new Color(
                color_stripe.r,
                color_stripe.r,
                color_stripe.r,
                masterfader_stripe_ui.value);

            prevLed_stripe_Color = color_stripe;
        }


        // OSC in OSC_Sender.cs
        // if (color_toilette != prevLed_toilette_Color) {
        //  // DMXData[port_led_toilette] = (byte)(color_toilette.r * masterfader_toilette_ui.value * 255);

        //  // see color also on an UI element in scene
        //  softwareLight_toilette_gui.GetComponent<Image>().color = new Color(
        //      color_toilette.r,
        //      color_toilette.r,
        //      color_toilette.r,
        //      masterfader_toilette_ui.value);

        //  prevLed_toilette_Color = color_toilette;
        // }

        // Settings für Lichterkette in DefineWS2812Pixels.cs -> Canvas/Panel_Header/UI-Lights/Lichterkette/Pixel



        // if (softwareLight_lichterkette.color != prevLed_lichterkette_Color) {
        //  DMXData[port_led_lichterkette] = (byte)(softwareLight_lichterkette.color.r * masterfader_lichterkette_ui.value * 255);

        //  // see color also on an UI element in scene
        //  softwareLight_lichterkette_gui.GetComponent<Image>().color = new Color(
        //      softwareLight_lichterkette.color.r,
        //      softwareLight_lichterkette.color.r,
        //      softwareLight_lichterkette.color.r,
        //      masterfader_lichterkette_ui.value);

        //  prevLed_lichterkette_Color = softwareLight_lichterkette.color;
        // }


        DMXData[4]  = (byte)255;        // DMX 5
        DMXData[14] = (byte)255;        // DMX 15
        DMXData[24] = (byte)255;        // DMX 25
        DMXData[6]  = (byte)115;        // DMX 7

        if (panel_dmxTester == menuManager.activePanel)
        {
            menuManager.OverrideDmxValues();
        }

        ArtEngine.SendDMX(0, DMXData, DMXData.Length);
    }