예제 #1
0
    public void OnUserRequestLeaveGame()
    {
        Debug.Log("OnUserRequestLeaveGame");
        _innerProcess.MoveNext(Command.LeaveGame);

        CancelInvoke("DelayedConnect");

        if (_networkLobbyManager != null)
        {
            _networkLobbyManager.StopClient();
            Destroy(_networkLobbyManager);
        }

        if (_discoveryClient != null)
        {
            _discoveryClient.serverDiscoveryEvent -= OnServerDiscovered;
            _discoveryClient.StopBroadcast();
            Destroy(_discoveryClient);
        }

        ensureCorrectScene();
    }