public void loadDialog(string titlestr, string msgstr, DialogPanelScript.ButtonOnClick yesCallBack, DialogPanelScript.ButtonOnClick noCallBack) { GameObject temp = GameObject.Instantiate(Resources.Load("Prefab/Image_Base_Dialog") as GameObject); temp.transform.parent = parent; temp.transform.localScale = Vector3.one; temp.transform.localPosition = Vector3.zero; temp.GetComponent <DialogPanelScript> ().setContent(titlestr, msgstr, true, yesCallBack, noCallBack); }
public void loadDialog(string titlestr, string msgstr, DialogPanelScript.ButtonOnClick yesCallBack, DialogPanelScript.ButtonOnClick noCallBack) { MainView = GameObject.FindWithTag("MainView"); parent = MainView.transform; GameObject temp = GameObject.Instantiate(Resources.Load("Prefab/Image_Base_Dialog") as GameObject); temp.transform.parent = parent.parent; temp.transform.localScale = Vector3.one; temp.transform.localPosition = new Vector3(0, 60); temp.GetComponent <DialogPanelScript> ().setContent(titlestr, msgstr, true, yesCallBack, noCallBack); temp.transform.SetSiblingIndex(parent.childCount - 1); }