2023-08-30 12:26:51 +00:00
|
|
|
|
# GURU Dof kcp Client
|
|
|
|
|
|
|
|
|
|
|
|
### VERSION 0.0.1
|
|
|
|
|
|
|
|
|
|
|
|
## 插件介绍
|
|
|
|
|
|
|
2023-08-31 03:15:38 +00:00
|
|
|
|
基于upm_guru_kcp库,服务与dof项目的客户端类封装.
|
|
|
|
|
|
在更新了prot文件之后,需要重新生成对应的cs文件。请按以下步骤进行操作:
|
2023-08-30 12:26:51 +00:00
|
|
|
|
|
2023-08-31 03:15:38 +00:00
|
|
|
|
## 安装 .NET 6.0 运行时(必须使用6.0版本)
|
|
|
|
|
|
* 下载离线安装包
|
2023-09-04 06:06:38 +00:00
|
|
|
|
- Mac: https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-6.0.413-macos-x64-installer
|
|
|
|
|
|
- Windows: https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-6.0.413-windows-x64-installer
|
2023-08-31 03:15:38 +00:00
|
|
|
|
|
2023-09-04 06:06:38 +00:00
|
|
|
|
* Mac下建议使用 homebrew
|
2023-08-31 03:15:38 +00:00
|
|
|
|
brew tap isen-ng/dotnet-sdk-versions
|
|
|
|
|
|
brew install --cask dotnet-sdk6-0-400
|
|
|
|
|
|
|
|
|
|
|
|
## 安装 protobuf-net.Protogen 命令行程序
|
|
|
|
|
|
dotnet tool install --global protobuf-net.Protogen --version 3.2.12
|
|
|
|
|
|
|
2023-09-04 06:06:38 +00:00
|
|
|
|
* Windows
|
|
|
|
|
|
protogen 的安装目录为 C:\Users\用户名\.dotnet\tools ,可直接在 cmd 命令行下运行 protogen
|
|
|
|
|
|
|
|
|
|
|
|
* Macos
|
|
|
|
|
|
在 Macos 下 protogen 的安装目录为 /Users/用户名/.dotnet/tools,可能需要手动将
|
|
|
|
|
|
```
|
|
|
|
|
|
PATH=PATH:/Users/用户名/.dotnet/tools
|
|
|
|
|
|
```
|
|
|
|
|
|
加入到 ~/.bash_profile中,因为 homebrew 加入的 PATH ~/.dotnet/tools 无效
|
2023-08-31 03:15:38 +00:00
|
|
|
|
|
|
|
|
|
|
## 生成 cs 文件
|
2023-09-04 06:06:38 +00:00
|
|
|
|
|
|
|
|
|
|
* Windows
|
|
|
|
|
|
```
|
2023-09-05 06:05:27 +00:00
|
|
|
|
cd upm_guru_dof_lib\Runtime\ServerProto
|
|
|
|
|
|
protogen messages.proto --csharp_out=..\NetworkGen
|
2023-09-04 06:06:38 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
* MacOS
|
|
|
|
|
|
```
|
2023-09-05 06:05:27 +00:00
|
|
|
|
cd upm_guru_dof_lib/Runtime/ServerProto
|
|
|
|
|
|
~/.dotnet/tools/protogen messages.proto --csharp_out=../NetworkGen
|
2023-09-04 06:06:38 +00:00
|
|
|
|
```
|
2023-08-30 12:26:51 +00:00
|
|
|
|
|
|
|
|
|
|
## 安装和接入
|
|
|
|
|
|
|
|
|
|
|
|
### 插件引入
|
|
|
|
|
|
|
|
|
|
|
|
- 本插件需要使用公司内部的Gitlab加载对应的repo, 详见 [Castbox内部git服务器Gitea使用指南](https://docs.google.com/document/d/1DiGPDD5Teu2QcYaBhqAcsqMbb3DJ5sdnTQMuvVzJSUk/edit#heading=h.w9tkkzwwyjxf)
|
|
|
|
|
|
- 根据文档部署好本机配置后, 请在Unity内部配置如下参数
|
2023-09-04 06:06:38 +00:00
|
|
|
|
- 修改位于项目Packages/manifest.json文件,在dependencies中添加
|
|
|
|
|
|
```
|
|
|
|
|
|
{
|
|
|
|
|
|
"dependencies": {
|
2023-09-04 06:10:22 +00:00
|
|
|
|
"com.guru.unity.gurudoflib": "git@git.chengdu.pundit.company:castbox/upm_guru_dof_lib.git",
|
2023-09-04 06:06:38 +00:00
|
|
|
|
...
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-04 07:34:45 +00:00
|
|
|
|
```
|
|
|
|
|
|
- 修改link.xml文件,添加
|
|
|
|
|
|
```
|
|
|
|
|
|
<assembly fullname="GuruDofLib.Runtime" preserve="all"/>
|
|
|
|
|
|
```
|