Hi, I am using NGUI3.6.5.
I found that whenever I use the following code to enable a button that made by a NGUI sprite, the texture of the 3D model in another camera will be affected.
using UnityEngine;
using System.Collections;
public class testNGUI : MonoBehaviour {
public GameObject testingSprite_GO;
public UISprite testingSprite_S;
private bool spriteEnabled = true;
private bool gameObjectEnabled = false;
void OnGUI(){
if(GUI
.Button(new Rect
(100,
350,
100,
50),
"Sprite On")){ testingSprite_S.enabled = !spriteEnabled;
spriteEnabled = !spriteEnabled;
}
if(GUI
.Button(new Rect
(100,
400,
100,
50),
"GameObject On")){ testingSprite_GO.SetActive(!gameObjectEnabled);
gameObjectEnabled = !gameObjectEnabled;
}
}
}
After enabling the button the material/ texture of the 3D model is broken, sometimes will be transparent),
The attachment can see the correct model and bugged model.
And this problem will be happen on iphone
When I build on Android or play on unity editor, the model will not have any problems.
It was troubled.



How can I use NGUI sprite but not affect the 3D model texture? Thanks!