コード例 #1
0
    public void SendCartData(int player_id, Vector3 pos, Vector3 rot)
    {
        int         id        = player_id - 1;
        NWMCartData cart_data = new NWMCartData();

        cart_data.SetArrays();
        cart_data.player_ID = player_id;
        cart_data.POSX[id]  = pos.x;
        cart_data.POSY[id]  = pos.y;
        cart_data.POSZ[id]  = pos.z;
        cart_data.ROTX[id]  = rot.x;
        cart_data.ROTY[id]  = rot.y;
        cart_data.ROTZ[id]  = rot.z;
        SendServerMessage(cart_data, unreliable);
    }
コード例 #2
0
    private void SendUpdatedCartData()
    {
        NWMCartData cart_data = new NWMCartData();

        cart_data.SetArrays();
        for (int i = 0; i < player_carts.Count; i++)
        {
            cart_data.POSX[i] = player_carts[i].transform.position.x;
            cart_data.POSY[i] = player_carts[i].transform.position.y;
            cart_data.POSZ[i] = player_carts[i].transform.position.z;
            cart_data.ROTX[i] = player_carts[i].transform.rotation.x;
            cart_data.ROTY[i] = player_carts[i].transform.rotation.y;
            cart_data.ROTZ[i] = player_carts[i].transform.rotation.z;
        }
        server.UpdateClientCarts(cart_data);
    }