コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        //Vector2 a = new Vector2(0f, 0f);
        //Vector2 b = new Vector2(1.0f, 1.0f);

        //var v = Vector2.Lerp(a, b,0.3f);
        //FSFloat t = 1;
        //Debug.Log(v.ToString());
        //FSQuaternion r = new FSVector4(1,1,1,1);
        //Quaternion

        var r   = new Transporter(null, null);
        var obj = new CustomProtocol.GameStart();

        obj.playId  = 1001;
        obj.udpPort = 3001;
        ushort t   = 0;
        var    seg = r.Encode(obj, out t);
        var    c   = new BufferCache();

        c.Write(seg.Array, seg.Array.Length);
        var y = r.Decode(c);

        Debug.Log("id:" + y.MsgId);
        var result = y.MsgObject as GameStart;

        Debug.Log("playId:" + result.playId + " " + result.udpPort);
    }