Exemple #1
0
    public void EnterFriendRoom(int idx)
    {
        Debug.Log("Enter Friend Room , " + idx);
        Client.instance.RoomEnter(idx);
        audio.clip = ButtonSound;
        audio.Play();

        //연결 해제
        RoomNetwork roomNetwork  = GameObject.Find("RoomNetworkManager").GetComponent <RoomNetwork>();
        GameObject  voiceNetwork = GameObject.Find("RoomNetworkManager");


        roomNetwork.StopHost();
        roomNetwork.StopClient();

        //Get Component
        //음성 해제
        //voiceNetwork.GetComponent<VoiceConnection>().Client.Disconnect();

        roomNetwork.networkAddress = Client.instance.roomIp;
        roomNetwork.networkAddress = roomNetwork.networkAddress.Substring(roomNetwork.networkAddress.IndexOf("192"));
        //음성네트워크 방제
        //voiceNetwork.GetComponent<ConnectAndJoin>().RoomName = roomList.GetChild(idx).GetComponentInChildren<Text>().text;


        roomNetwork.StartClient();
        //StartCoroutine(WaitForTexture(0.7f));
        string voiceRoom = roomList.GetChild(idx).GetComponentInChildren <Text>().text;

        char[] checkName = roomList.GetChild(idx).GetComponentInChildren <Text>().text.ToCharArray();
        for (int i = 0; i < checkName.Length; i++)
        {
            if (!char.IsLetterOrDigit(checkName[i]))
            {
                Debug.Log(i);
                voiceRoom = roomList.GetChild(idx).GetComponentInChildren <Text>().text.Remove(i);
                break;
            }
        }
        roomNetwork.JoinOrCreateRoom(voiceRoom);
        //voiceNetwork.GetComponent<ConnectAndJoin>().ConnectNow();
    }
Exemple #2
0
    public void EnterMyRoom()
    {
        RoomNetwork roomNetwork  = GameObject.Find("RoomNetworkManager").GetComponent <RoomNetwork>();
        GameObject  voiceNetwork = GameObject.Find("RoomNetworkManager");

        if (roomNetwork.networkAddress == "localhost")
        {
            return;
        }

        //loadSlotMenu.SetActive(true);

        //만약 이미 내 방이라면 옮길 필요가 없음

        Furniture.GetComponent <FurnitureManager>().Clear();

        Client.instance.RoomMake();
        audio.clip = ButtonSound;
        audio.Play();


        roomNetwork.StopHost();
        roomNetwork.StopClient();
        //voiceNetwork.GetComponent<VoiceConnection>().Client.Disconnect();
        //voiceNetwork.GetComponent<VoiceConnection>().


        roomNetwork.networkAddress = Client.instance.roomIp;
        roomNetwork.networkAddress = roomNetwork.networkAddress.Substring(roomNetwork.networkAddress.IndexOf("192"));
        Client.instance.curRoom    = Client.instance.UserID;
        //voiceNetwork.GetComponent<ConnectAndJoin>().RoomName = Client.instance.UserID;
        StartCoroutine(Wait(0.5f));
        roomNetwork.StartHost();



        roomNetwork.JoinOrCreateRoom(Client.instance.UserID);
        //voiceNetwork.GetComponent<ConnectAndJoin>().ConnectNow();
    }