示例#1
0
 public void UpdateImage(bool updatePreview = true)
 {
     for (int y = 0; y < Height; y++)
     {
         for (int x = 0; x < Width; x++)
         {
             int pi = x + y * Width;
             //int ci = info.Parts[CurrentSubPattern].X + x + (info.Parts[CurrentSubPattern].Y + y) * CurrentPattern.Width;
             var resultC = new UnityEngine.Color(1f, 1f, 1f, 0f);
             for (int j = 0; j < Layers.Count; j++)
             {
                 resultC = resultC.AlphaComposite(Layers[j].Colors[pi]);
                 if (j == _SelectedLayer && TemporaryLayer != null)
                 {
                     resultC = resultC.AlphaComposite(TemporaryLayer.Colors[pi]);
                 }
             }
             Colors[pi] = resultC;
         }
     }
     if (updatePreview)
     {
         Pattern.RegeneratePreview();
     }
     Pattern.Editor.OnImageUpdated();
 }