コード例 #1
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();
    }