コード例 #1
0
ファイル: Menu.cs プロジェクト: TSffer/Escape-Game
 private void StopDiscovery()
 {
     if (myNetworkDiscovery.running)
     {
         myNetworkDiscovery.StopBroadcast();
     }
 }
コード例 #2
0
 /** Callback functions **/
 public void OnConnected(NetworkMessage netMsg)
 {
     Debug.Log("Connected :" + netMsg.conn.address);
     isConnecting = true;
     // if started as client
     if (!NetworkServer.active)
     {
         Debug.Log("client 停止广播接收");
         sendUid();
         discovery.StopBroadcast();
         GameManager.Instance.gameUI.SetExplainText("已连接至服务器,请准备");
     }
     else
     {
         GameManager.Instance.gameUI.SetExplainText("有客户端加入房间,请准备");
     }
 }
コード例 #3
0
    public void CreateRoom()
    {
        soundManager.SFX_MenuButtonPlay();
        soundManager.FindingLobbyTrackPlay();

        UIAnimator.SetBool("Find_Waiting", false);
        UIAnimator.SetBool("Create_waiting", true);

        CreateRoomBtn.SetActive(false);
        DifficultyLevelDropDownPanel.SetActive(false);
        FindRoomBtn.SetActive(true);

        switch (DifficultyLevel.value)
        {
        case 0:
            CharacterLife.difficultyLevel = global::DifficultyLevel.NormalWitch;
            break;

        case 1:
            CharacterLife.difficultyLevel = global::DifficultyLevel.EvilWitch;
            break;

        case 2:
            CharacterLife.difficultyLevel = global::DifficultyLevel.CrazyWitch;
            break;

        default:
            break;
        }

        networkDiscovery.StopBroadcast();


        var newHost = networkManager.StartHost();

        if (newHost == null)
        {
            StopCoroutine(ShowError());
            StartCoroutine(ShowError());
        }

        //networkManager.StartHost();
        networkDiscovery.StartBroadcast();
    }
コード例 #4
0
    void Cleanup()
    {
        isInDelayedStart = false;
        if (discovery != null && discovery.running && discovery.isActiveAndEnabled)
        {
            discovery.StopBroadcast();
        }

        if (IsClientConnected())
        {
            StopClient();
        }

        StopHost();
    }
コード例 #5
0
 public override void OnStopServer()
 {
     m_NetworkDiscovery.StopBroadcast();
 }
コード例 #6
0
 public void EndBroadcast()
 {
     netDiscover.StopBroadcast();
     netDiscover.Initialize();
 }
コード例 #7
0
 public void StopBroadcast()
 {
     localNetworkDiscovery.StopBroadcast();
 }