示例#1
0
    /// <summary>
    ///
    /// </summary>
    public void join_Room(Room target)
    {
        RoomJSON data = new RoomJSON();

        ClientStatus.currentingRoom = target.Name;
        data.name = target.Name;
        data.UUID = ClientStatus.UUID;
        //data.index = target.index;


        string Data = RoomJSON.CreateToJSON(data);

        socket.Emit("joinRoom", new JSONObject(Data));
        Destroy(target.gameObject);

        mainCanvas.gameObject.SetActive(false);
    }
示例#2
0
    public void CreateRoom()
    {
        if (inputField.text.Equals(""))
        {
            return;
        }

        RoomJSON data = new RoomJSON();

        ClientStatus.currentingRoom = inputField.text;
        data.name = inputField.text;
        data.UUID = ClientStatus.UUID;

        string Data = RoomJSON.CreateToJSON(data);

        socket.Emit("creatRoom", new JSONObject(Data));

        socket.Emit("joinRoom", new JSONObject(Data));
        mainCanvas.gameObject.SetActive(false);
        inputField.text = "";
    }
示例#3
0
    void LateUpdate()
    {
        if (ClientStatus.GameOver)
        {
            RoomJSON data = new RoomJSON();
            data.name = ClientStatus.currentingRoom;
            data.UUID = ClientStatus.UUID;
            string Data = RoomJSON.CreateToJSON(data);
            socket.Emit("joinlobby", new JSONObject(Data));

            ClientStatus.currentingRoom = "lobby";
            Destroy(Players[ClientStatus.currentUUID[0]]);
            Destroy(Players[ClientStatus.currentUUID[1]]);
            Destroy(Ball);
            ClientStatus.currentUUID[0] = "";
            ClientStatus.currentUUID[1] = "";

            uimager.ReturnLobby();
            Destroy(this.gameObject);
            ClientStatus.GameOver = false;
        }
    }