Hey Guys,
I am trying to take a screenshot using a render texture. My code works fine in the editor and on Android too, but on iOS, I get a white texture. I am surprise because, when a texture is empty, I though that it was all black, so it seems like it captures something, but it is all white. Here is my code :
public IEnumerator TakeScreenShot()
{
yield return new WaitForEndOfFrame();
mTex = new RenderTexture(Screen.width, Screen.height, 0);
RenderTexture tempTexture = RenderTexture.active;
RenderTexture.active = mTex;
Camera.allCameras [0].targetTexture = mTex;
RenderTexture.active = tempTexture;
Camera.allCameras [0].targetTexture = null;
gameObject.GetComponent ().materials [0].SetTexture (0, mTex);
gameObject.GetComponent ().materials [1].SetTexture (0, mTex);
StartAnimation ();
}
Does anybody have an idea ? Thanks a lot for your time !
Claude
↧