How to use RenderTexture IsCreated Function

Hey, im having some problems with my rendertextures, going all wonky when I minimize the game then open it back up. Any solutions for this?

Documentation says this:
“Keep in mind that render texture contents can become “lost” on certain events, like loading a new level, system going to a screensaver mode, in and our of fullscreen and so on. When that happens, your existing render textures will become “not yet created” again, you can check for that with IsCreated function.”

I can’t seem to solve this, this was what I did for my last attempt:

var rt: RenderTexture;


function Update () {
    if (rt.IsCreated == false);{
	rt = new RenderTexture(256, 256, 16, RenderTextureFormat.ARGB32);
	rt.Create();
}
}

Thank you!

I ended up trying something else, simply covering up the texture with a new texture when alt-tabbing out of the game, using OnApplicationFocus. When I take a new photo, it simply disables the new texture.

var paused: boolean;
var screen1: GameObject;
var tex1: GameObject;
var PhotoObject: GameObject;
var PhotoObject2: GameObject;

function Start (){
paused = false;
}

function Update () {
   if (PhotoObject.activeInHierarchy){
	  paused = false;
	  screen1.SetActive (false);
	  tex1.SetActive (false);
	  }
   if (PhotoObject2.activeInHierarchy){
	  paused = false;
	  screen1.SetActive (false);
	  tex1.SetActive (false);
	  }
  if(paused) {
           
        screen1.SetActive (true);
        tex1.SetActive (true);
       }
    }

 
	
	    function OnApplicationFocus(focusStatus: boolean) {
		paused = focusStatus;
      }