I’m trying to display the render texture in a Gui Window. I have the render texture set up from a camera and created a material for it. Now I want to display inside the gui window. I tried placing the material inside the Resource folder and use Resources.Load to load it as a texture, but I get a “cannot cast source type to destination type error”. Is there an easier way to do this?
var tex:Texture2D = Resources.Load(“Resources/Rend”);
function OnGUI() {
GUI.Window(0,Rect(200,129,100,100),funcwin,“window”);
}
function funcwin(windowID:int)
{
GUI.DrawTexture(Rect(0, 0, 100, 100), tex);
}