Assign Texture2D at runtime

Is it possible to assign a Texture2D that’s taken from a screenshot at runtime? When I try this, the assigned texture2d reads “missing” in the inspector…

The texture2d screenshot worked because it successfully arrives at serverside

Brief outline of code:

 var tex  = new Texture2D( .... );
 tex.ReadPixel( ... );
 tex.Apply();
 assignedTexture2D=tex;

assignedTexture2D shows “missing” in inspector.

go through this link it might help you.
http://unity3d.com/support/resources/example-projects/texture-plugins.html

I’m not sure what you would expect to see in the inspector…

You’re not assigning a named texture to the variable. You’re assinging a texture that you built. It has no handle to the file system or the unity editor.

Also, when you make changes to your scene while playing your game, they are typically erased when you come out of play mode.