Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

Dynamically changing a texture

$
0
0
Sorry for my English, I'm using Google Translate.

I have the code below and I need to change the texture contained in the GUI.Label dynamically. I've tried it in many ways and I could not. Can you help me? Thank you!

Code (CSharp):
  1. public Texture2D cTexture;
  2.  
  3. cTexture = (Texture2D)Resources.Load("Prefabs/Players/Images/char1_image");
  4.         GUI.Label(new Rect(screenWidth - 690, screenHeight / 2 - 230, 500, 500), cTexture);

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>