コード例 #1
0
    /// <summary>
    /// read the packet we get from over the network
    /// </summary>
    public void HandleSubPacket(Packet _packet)
    {
        SubPacket _subPacket = new SubPacket();

        _subPacket.Read(_packet);

        //==> OBJECT COUNT
        int _count = _subPacket.ReadInt();

        for (int i = 0; i < _count; i++)
        {
            //==> GUID
            string _guid = _subPacket.ReadString();
            //==> NAME
            string _name = _subPacket.ReadString();
            //==> POS
            Vector3 _pos = _subPacket.ReadVector3();
            //==> ROT
            Quaternion _rot = _subPacket.ReadQuaternion();
            //==> SCALE
            Vector3 _scale = _subPacket.ReadVector3();

            //SPAWN THE OBJECT
            SpawnNetObject(_guid, _name, _pos, _rot, _scale);
        }
    }