Greetings,
I'm very new to Unity and NGUI but i'm starting to get a hold of everything. But i'm trying to make a NGUI prefab (a window and a few buttons) "pop up" when I click on a game object. For the script to show and hide the pop up I have:
public GameObject prefab;
private bool isVisible;
// Use this for initialization
void Start () {
prefab.gameObject.SetActiveRecursively(true);
}
// Update is called once per frame
void Update () {
}
public void toggleVisible() {
if(!isVisible){
prefab.gameObject.SetActiveRecursively(false);
isVisible=false;}
else{
prefab.gameObject.SetActiveRecursively(true);
isVisible=true;}
}
I'm not sure how to create this prefab and place it on the screen under the correct place (UI Root 2D -> Camera -> Anchor -> Panel correct?). Again I apologize because I probably know this is a noob question!
Thanks,
Jason