Load Render Textures into Raw Image Object via C#

Hello Everyone,

I’m Roshan Aravinda and newcomer for unity. I’m developing a project as my final year project in university. With that project I have a UI panel and there is a Raw image object named as “rawmodel”.

And also I have two render textures models as follows. (box_model and spr_model)

Now my problem is I need to change the Texture property of Raw Image(rawmodel) object as box_model or spr_model by using C# script. Manually I can change the Texture property with those render textures and also it works perfectly. But I need to do with it C#.

If there is a anyone who is like to help me, I appreciate your valuable response for me.

Thank You!

it is simple bro make two variables of type Texture

public Texture renderTexture1; public Texture renderTexture1;

now make a RawImage Variable

public RawImage rawImage;

now change the texture of rawImage that you want;

rawImage.Texture = renderTexture1;

and vice versa;