public void Build(Texture2D target) { if (HasChildren) { Left.Build(target); Right.Build(target); } if (texture) { if (target.format == TextureFormat.ARGB32 && texture.format == TextureFormat.ARGB32) //faster only on argb32 { var data = texture.GetPixels32(0); target.SetPixels32((int)rect.x, (int)rect.y, texture.width, texture.height, data); } else { var data = texture.GetPixels(0); target.SetPixels((int)rect.x, (int)rect.y, texture.width, texture.height, data); } } }
public T Build() { return(Build(Left.Build(), Right.Build())); }