Hi, does anyone know of a really good (artist + limited C#) explanation of hiding and un-hiding NGUI UI elements?
I am using - probably very inefficiently - NGUITools.SetActive(true/false). It has taken me half a day to understand that I need to leave a GameObject higher up the hierarchy 'active' to be able set 'false' items back to 'true' - this is the level I am working at
Any help with writing better code will be much appreciated. Thank you.
public class display : MonoBehaviour {
public static GameObject selectNpc01Message;
void Start(){
}
void Update() {
if (GetComponent<triggerNpc01>().triggerActiveNpc01 == true){
selectNpc01Message = GameObject.Find("selectNpc01");
NGUITools.SetActive(selectNpc01Message,true);
if (Input.GetKeyDown("space")){
Debug.Log("space key was pressed");
}
}
else{
selectNpc01Message = GameObject.Find("selectMessage");
NGUITools.SetActive(selectNpc01Message,false);
}
}
}