What I want to do is when you right click on a selection, instantiated from a prefab and list, it will bring up a window and ask if you want to do a certain action, then click yes or no buttons.
No matter what I do, I can’t seem to get a reference. I thought if I moved the open window script to its own script, that would fix it, only it still says unassigned reference or null reference.
Scripts:
public Canvas DialogueCanvas;
public bool windowOpen=false;
public bool DialogueOpen=false;
public void OpenDialogWindow()
{
if(windowOpen==false)
{
windowOpen=true;
DialogueCanvas.enabled = true;
}
else if(windowOpen==true)
{
windowOpen=false;
DialogueCanvas.enabled=false;
}
}
This is attached to the dialogue canvas
public Canvas DialogueCanvas;
public DialogueWindow DW;
public void ClickRight()
{
//DBIndexList.Clear ();
Debug.Log ("You clicked Right!");
DW = DialogueCanvas.GetComponent<DialogueWindow> ();
DW.OpenDialogWindow ();
}
This is attached to the prefab.
When I try to drag the canvas over, it won’t let me attach it.
Where am I going wrong? Since this is a delete operation, I’d like to have a dialogue, just in case.
Thanks guys!