loadedTexture = www.texture;
normalTexture = new Texture2D(loadedTexture.width,loadedTexture.height,TextureFormat.ARGB32,false);
Color theColour = new Color();
for (int x=0; x<loadedTexture.width; x++){
- for (int y=0; y<loadedTexture.height; y++){
theColour.r = loadedTexture.GetPixel(x,y).g;
theColour.g = theColour.r;
theColour.b = theColour.r;
theColour.a = loadedTexture.GetPixel(x,y).r;
- normalTexture.SetPixel(x,y, theColour);
}
}
normalTexture.Apply();