[Unity] get Texture2D from textureSource?
Posted: 01 Dec 2015, 15:35
Hi !
Using the sample from imagestutorial i could convert a texture2D to texturesource:
Now, I need to get the texture2d from the TextureSource.
Something like this:
bMyLogo.GetBackground().As<ImageBrush>().GetImageSource().As<TextureSource>().GetTexture2D()
Is there any way to do this?
Thanks in advance.
Using the sample from imagestutorial i could convert a texture2D to texturesource:
Code: Select all
Grid grid = GetComponent<NoesisGUIPanel>().GetRoot<Grid>();
Texture2D texture = Resources.Load("Noesis") as Texture2D;
TextureSource source = new TextureSource(texture);
Image image = grid.FindName<Image>("image");
image.SetSource(source);
Something like this:
bMyLogo.GetBackground().As<ImageBrush>().GetImageSource().As<TextureSource>().GetTexture2D()
Is there any way to do this?
Thanks in advance.