Hey,
I have a panel inside another panel. I need to set the image sprite of the inner panel, and then set the outer panel to active (which in turn sets the inner panel active).
The problem, is when this happens, it defaults the inner panel’s image back to its original, blank image. Here is my snippet:
Texture2D Image = new Texture2D(2, 2);
Image.LoadImage(www.bytes);
Sprite ImageSprite = Sprite.Create(Image, new Rect(0, 0, 600, 600), new Vector2(0.5f, 0.5f));
NewsImage.sprite = ImageSprite;
StartCoroutine(Utils.FadeIn(NewsPanel, 4.0f));
One of the first things Utils.FadeIn does is set the incoming GO (first parameter) to active with SetActive(true).
It is at this point that the image on NewsImage is defaulting back to its original.