public XCell(Layer layer)
        {
            _autoAlpha = new AutoAlpha(Resolution);

            Layer = layer;
            Nii   = 1;

            ListOfOutputChannels = new List <Channel>();
            ListOfInputChannels  = new List <Channel>();

            Atomizer = new Atomizer();
            Router   = new Router();
        }
Ejemplo n.º 2
0
        public XCell(string idSequence, Layer layer)
        {
            _autoAlpha = new AutoAlpha();

            Layer = layer;
            Id    = idSequence;
            Nii   = 1;

            ListOfOutputChannels = new List <Channel>();
            ListOfInputChannels  = new List <Channel>();

            Atomizer = new Atomizer();
            Router   = new Router();
        }
Ejemplo n.º 3
0
 private void ChangeAlpha(float alpha)
 {
     if (this.Type == ChangeAlphaType.Material)
     {
         for (int i = 0; i < this.rens.Length; i++)
         {
             Renderer renderer          = this.rens[i];
             string   materialColorName = AutoAlpha.GetMaterialColorName(renderer.sharedMaterial);
             if (materialColorName != null)
             {
                 Color color = renderer.material.GetColor(materialColorName);
                 color.a = alpha;
                 renderer.material.SetColor(materialColorName, color);
             }
         }
     }
     else
     {
         for (int j = 0; j < this.meshFilters.Length; j++)
         {
             Color[] array = this.meshFilters[j].mesh.colors;
             if (array.Length == 0)
             {
                 if (this.meshFilters[j].mesh.vertices.Length == 0)
                 {
                     NcSpriteFactory.CreateEmptyMesh(this.meshFilters[j]);
                 }
                 array = new Color[this.meshFilters[j].mesh.vertices.Length];
                 for (int k = 0; k < array.Length; k++)
                 {
                     array[k] = Color.white;
                 }
             }
             for (int l = 0; l < array.Length; l++)
             {
                 Color color2 = array[l];
                 color2.a = alpha;
                 array[l] = color2;
             }
             this.meshFilters[j].mesh.colors = array;
         }
     }
 }