Ejemplo n.º 1
0
        public IEnumerator WaitForRequestRoom(short roomIndex, RoomManager.StartGame dele) // 게임방에 입장 가능한지 확인
        {
            WWWForm form = new WWWForm();

            form.AddField("gamecode", GameManager.instance.GameCode);
            form.AddField("roomindex", roomIndex);
            UnityWebRequest www = UnityWebRequest.Post(m_checkRoomUrl, form);

            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                //Debug.Log(www.downloadHandler.text);
                checkroom checker = JsonUtility.FromJson <checkroom>(www.downloadHandler.text);
                //Debug.Log(checker.roomstate);
                dele(checker.roomstate);
            }
        }
Ejemplo n.º 2
0
 public void GetRoomData(short roomIndex, RoomManager.StartGame dele) // 방 정보 가져오기 인자 방 정보, 종료 이벤트
 {
     StartCoroutine(WaitForRequestRoom(roomIndex, dele));
 }