Release Protocol Buffers v3.19.4 · protocolbuffers/protobuf · GitHub
导入Source code 里面的 csharp/src/Google.Protobuf 进入Unity
拷贝其他版本的 System.Runtime.CompilerServices.Unsafe进入工程
使用protoc-3.19.4-win32 里面的exe去编译proto文件为C#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using UnityEditor;
using UnityEngine;
//F:
//cd F:\TUANJIEProject\client\Common\NetProto\GenCSharp\Proto
//单文件生成
//protoc.exe --csharp_out=./ --proto_path =./ Common.proto
//整个文件夹下生成
//protoc --proto_path=./src --csharp_out=../Proto ./src/*.proto
//PAUSE
public s