1
NGUI 3 Support / Pic does not show up after mainTexture assigned.
« on: April 25, 2014, 09:17:02 AM »
If I click the button, the texture show.
But if I change the PicReady from its own class, the texture not show....
Is it any hidden function inside the OnClick event that need to update or redraw the pic. Any other function I need to call if I update the texture outside the on click event?
But if I change the PicReady from its own class, the texture not show....
Is it any hidden function inside the OnClick event that need to update or redraw the pic. Any other function I need to call if I update the texture outside the on click event?
- public UITexture uiTexture;
- public MyPicPick MyPic;
- void Start() {
- StartCoroutine(UpdateImage());
- }
- void OnClick() {
- NGUIDebug.Log("Call From On Click");
- MyPic.PicReady = true;
- }
- public void ChangePicReady() {
- NGUIDebug.Log("Call From Other");
- MyPic.PicReady = true;
- }
- IEnumerator UpdateImage() {
- while (true) {
- if (MyPic.PicReady) {
- string url = "file://" + PlayerPrefs.GetString("PicPath");
- yield return www;
- uiTexture.mainTexture = www.texture;
- }
- }
- }