void OnCancelKeyPress() { //if (Application.platform == RuntimePlatform.Android) //{ if (Input.GetKeyDown(KeyCode.Escape) && isPopup == false) { isPopup = true; QuitPopup.show(new QuitPopupOptions { cancelButtonDelegate = () => { Debug.Log("cancel"); isPopup = false; }, okButtonDelegate = () => { Debug.Log("ok"); PhotonNetwork.Disconnect(); SceneManager.LoadScene("join_create"); isPopup = false; } }); } //} }
void OnCancelKeyPress() { if (Input.GetKeyDown(KeyCode.Escape) && isPopup == false) { isPopup = true; QuitPopup.show(new QuitPopupOptions { cancelButtonDelegate = () => { Debug.Log("cancel"); isPopup = false; }, okButtonDelegate = () => { Debug.Log("ok"); SceneManager.LoadScene("join_create"); isPopup = false; } }); } }
public static QuitPopup show(QuitPopupOptions options) { if (prefab == null) { prefab = Resources.Load("QuitPopup") as GameObject; } GameObject popupPrefab = Instantiate(prefab) as GameObject; QuitPopup popup = popupPrefab.GetComponent <QuitPopup>(); popup.updateContent(options); return(popup); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////// 플레이어 퇴장 관련 함수들 ////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void OnCancelKeyPress() { //if (Application.platform == RuntimePlatform.Android) //{ if (Input.GetKeyDown(KeyCode.Escape) && isPopup == false) { isPopup = true; QuitPopup.show(new QuitPopupOptions { cancelButtonDelegate = () => { Debug.Log("cancel"); isPopup = false; }, okButtonDelegate = () => { Debug.Log("ok"); if (playerPosition != -1) // playerPosition이 설정 되지 않은 상태에선 그냥 창만 닫음 { pv.RPC("playerQuit", PhotonTargets.MasterClient, playerPosition); } else { PhotonNetwork.Disconnect(); SceneManager.LoadScene("join_create"); } isPopup = false; } }); } //} }