I just need the pixel Infos from Sprite A.. Sprite C can also be any other Object, that fits better to draw the read pixels
- Update -
i tried to create a Texture like this as a simple test:
1. I added a plain GameObject to the scene
2. I assigned SpriteRenderer Script
3. I assigned a little custom script, that i call from Update() function of another gameobject (i assigned this new gameobject to the other one
and access the function via getComponent<T>() call.)
void drawColors ()
{
Debug.Log ("drawColors()");
Texture2D newTex = new Texture2D(500,500, TextureFormat.ARGB32, false);
for(int x = 200; x < 300; x++)
for(int y = 200; y < 300; y++)
newTex.SetPixel(x,y,Color.green);
newTex.Apply();
renderer.material.mainTexture = newTex;
}
Nothing happens! What do i wrong?