Example #1
0
    void setSegmentPower(int column, int segment)
    {
        List <GameObject> col = ledsColumns [column];

        for (int i = 0; i < col.Count; i++)
        {
            if (i <= segment)
            {
                col[i].GetComponent <Renderer>().enabled  = true;
                col[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), true);
            }
            else
            {
                if (hideWhenOff)
                {
                    col[i].GetComponent <Renderer>().enabled = false;
                }
                else
                {
                    col[i].GetComponent <Renderer>().enabled  = true;
                    col[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), false);
                }
            }
        }
    }
Example #2
0
 void setSegmentVolume(int column, int segment)
 {
     if (column == 0)
     {
         for (int i = 0; i < ledsChannel1.Count; i++)
         {
             if (i <= segment)
             {
                 ledsChannel1[i].GetComponent <Renderer>().enabled  = true;
                 ledsChannel1[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), true);
             }
             else
             {
                 if (hideWhenOff)
                 {
                     ledsChannel1[i].GetComponent <Renderer>().enabled = false;
                 }
                 else
                 {
                     ledsChannel1[i].GetComponent <Renderer>().enabled  = true;
                     ledsChannel1[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), false);
                 }
             }
         }
     }
     else
     {
         for (int i = 0; i < ledsChannel2.Count; i++)
         {
             if (i <= segment)
             {
                 ledsChannel2[i].GetComponent <Renderer>().enabled  = true;
                 ledsChannel2[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), true);
             }
             else
             {
                 if (hideWhenOff)
                 {
                     ledsChannel2[i].GetComponent <Renderer>().enabled = false;
                 }
                 else
                 {
                     ledsChannel2[i].GetComponent <Renderer>().enabled  = true;
                     ledsChannel2[i].GetComponent <Renderer>().material = allMaterials.getMaterial(colorSchemaIndex, segmentColor(i), false);
                 }
             }
         }
     }
 }