# Protobuf3_for_Unity ILRuntime **Repository Path**: absence/protobuf3_for_-unity-ilruntime ## Basic Information - **Project Name**: Protobuf3_for_Unity ILRuntime - **Description**: 基于最新的protobuf3.21.12从源码制作 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-01-26 - **Last Updated**: 2023-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: protobuf, Unity, iltuntime ## README # Protobuf3_for_Unity ILRuntime #### 介绍 基于最新的protobuf3.21.12从源码制作,理论修改方式支持后续proto版本 #### 软件架构 如使用旧版可以参考https://github.com/gongxun/protobuf3-for-Unity-and-ILRuntime 此指引大家自己动手修改源代码,编译源代码,不做拿来之人。 #### 安装教程 1. 准备:protobuf csharp源码:https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protobuf-csharp-3.21.12.zip cmake工具:https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-windows-x86_64.msi visual studio 2022 ,需安装模块 ![输入图片说明](pic/image1.png) ![输入图片说明](pic/image2.png) ![输入图片说明](pic/image3.png) 2. cmake配置 config->select x64->generate->unselect build tests->generate生成visual studio 工程 ![输入图片说明](pic/image4.png) ![输入图片说明](pic/image5.png) or use cmake command line: local src="/f/Protobuf 3.21" local build="$src/cmake/Build" cmake -S "$src" "$build" 3. src/google/protobuf/compiler/csharp替换三个文件,再打开protobuf-3.21.12\cmake\Build\protobuf.sln 编译protoc or use command line: VS_PATH="/c/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/devenv.exe" local logpath="$build/Build/build_vs.log" "$VS_PATH" "$build/protobuf.sln" //build "Release" //Project protoc //out "$logpath" #### 使用说明 1. 生成的proto cs 文件移除了JsonParser、FileDescriptor反射,Clone,equal,WellKnownTypes,unknowfield等不需要的功能。 2. 支持ilruntime,提供了adaptor、测试代码