private Texture2D ProcessTextureForType(Texture2D sourceTexture, TextureScale textureScale) { Texture2D texture; if (textureScale.HasFlag(TextureScale.Small)) { texture = new Texture2D(sourceTexture.width, sourceTexture.height, TextureFormat.RGBA32, true, false); for (var i = 0; i < sourceTexture.mipmapCount; i++) { var c_0 = sourceTexture.GetPixels(i); var c_1 = texture.GetPixels(i); for (var i1 = 0; i1 < c_0.Length; i1++) { var a = c_0[i1].r + c_0[i1].g + c_0[i1].b; c_1[i1].r = c_1[i1].g = c_1[i1].b = a > 127 ? 0 : 1; c_1[i1].a = c_0[i1].a; } texture.SetPixels(c_1, i); } texture.Apply(); } else { texture = new Texture2D(sourceTexture.width, sourceTexture.height, TextureFormat.RGBA32, true); texture.SetPixels(sourceTexture.GetPixels()); texture.Apply(); } return(texture); }