public P2PPacketId CreateUnit(byte[] data)
    {
        CreateUnitDataPacket createUnitDataPacket = new CreateUnitDataPacket(data);
        CreateUnitData       createUnitData       = createUnitDataPacket.GetData();

        dungeonManager.CreateUnit(createUnitData.ID, new Vector3(createUnitData.PosX, createUnitData.PosY, createUnitData.PosZ));

        return(P2PPacketId.None);
    }
示例#2
0
    //캐릭터의 생성을 보내주는 메소드
    public void CreateUnitSend(short newId, Vector3 position)
    {
        short id   = newId;
        float xPos = position.x;
        float yPos = position.y;
        float zPos = position.z;

        CreateUnitData       createUnitData       = new CreateUnitData(id, xPos, yPos, zPos);
        CreateUnitDataPacket createUnitDataPacket = new CreateUnitDataPacket(createUnitData);

        DataPacket packet = CreatePacket(createUnitDataPacket.GetPacketData(), P2PPacketId.CreateUnit);

        packet.endPoint = NetworkManager.client1;
        sendMsgs.Enqueue(packet);
    }
示例#3
0
    //캐릭터의 생성을 보내주는 메소드
    public void CreateUnitSend(short newId, Vector3 position)
    {
        short Id   = newId;
        float xPos = position.x;
        float yPos = position.y;
        float zPos = position.z;

        CreateUnitData       createUnitData       = new CreateUnitData(Id, xPos, yPos, zPos);
        CreateUnitDataPacket createUnitDataPacket = new CreateUnitDataPacket(createUnitData);

        byte[] msg = CreatePacket(createUnitDataPacket, P2PPacketId.CreateUnit);

        DataPacket packet = new DataPacket(msg, NetworkManager.client1);

        sendMsgs.Enqueue(packet);
    }