public void Popup_Test_Click(object sender, RoutedEventArgs e) { Console.WriteLine("Popup Listener Test"); // Game_Popup gpop = new Game_Popup(); PopupLogic popup1 = new PopupLogic(); this.Dispatcher.Invoke(() => popup1.Test()); }
void SummonPopup() { //RectTransform m_tempRect = new RectTransform(); //m_tempRect.localPosition = new Vector3(UnityEngine.Random.Range(-620, 900), UnityEngine.Random.Range(-350, 500), 0); m_popupWindow = GameObject.Instantiate(PopUpPrefab, Vector3.zero, Quaternion.identity, m_canvas.transform); m_popupWindow.GetComponent <RectTransform>().localPosition = new Vector3(UnityEngine.Random.Range(-620, 900), UnityEngine.Random.Range(-350, 500), 0); m_popupLogic = m_popupWindow.GetComponent <PopupLogic>(); }