- Home /
This question was
closed Oct 09, 2021 at 12:00 AM by
PandixDevelopment for the following reason:
The question is answered, right answer was accepted
Question by
PandixDevelopment · Oct 08, 2021 at 10:49 PM ·
materialtexture2dconvertwebview
Convert material into texture2D?
Hello I need to check the pixel color in a set spot in a Material but need to convert it into a Texture2D to do this. I am not worried if it needs to be round about because im not sure i have any other options for this as its a webview
public Texture2D tempTexture;
public RawImage Raw;
void buttonPress()
{
var tempMaterial = Raw.material;
//Covert tempMaterial into tempTexture
}
Comment
Best Answer
Answer by PandixDevelopment · Oct 08, 2021 at 11:59 PM
public Texture2D tempTexture;
public RawImage Raw;
void buttonPress()
{
tempTexture = Raw.material.GetTexture("_MainTex") as Texture2D;
}
Figured it out myself with a bit more time.