Esempio n. 1
0
 private TextureSet CombineSet(TextureSet source, TextureSet target, AtlasTile sourcePosition)
 {
     target.Albedo = CombineTexture(source.Albedo, target.Albedo, sourcePosition, Color.clear);
     //target.Emission = CombineTexture(source.Emission, target.Emission, sourcePosition, Color.clear);
     //target.Height = CombineTexture(source.Height, target.Height, sourcePosition, Color.clear);
     //target.Normal = CombineTexture(source.Normal, target.Normal, sourcePosition, new Color(128, 128, 255));
     //target.Occulsion = CombineTexture(source.Occulsion, target.Occulsion, sourcePosition, Color.clear);
     return(target);
 }
Esempio n. 2
0
 private Texture2D CombineTexture(Texture2D source, Texture2D target, AtlasTile sourcePosition, Color blankFill)
 {
     if (source == null)
     {
         source = new Texture2D(_textureSize, _textureSize, TextureFormat.ARGB32, false);
         var fill = new Color[_textureSize * _textureSize];
         for (int i = 0; i < fill.Length; i++)
         {
             fill[i] = blankFill;
         }
         source.SetPixels(fill);
     }
     ;
     if (target == null)
     {
         target = CreateMapTexture();
     }
     target.SetPixels(sourcePosition.X * _textureSize, sourcePosition.Y * _textureSize, _textureSize, _textureSize, source.GetPixels());
     return(target);
 }