コード例 #1
0
    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;
                }
            });
        }
        //}
    }
コード例 #2
0
    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;
                }
            });
        }
    }
コード例 #3
0
    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);
    }
コード例 #4
0
ファイル: Lobby.cs プロジェクト: gkrtn12394/Unity_Together
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////// 플레이어 퇴장 관련 함수들 //////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    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;
                }
            });
        }
        //}
    }