Godot 添加Nuget 引用

前言

我的Godot 专栏

我在之前的文章中,解决了Visual Studio 如何去调试正在运行的Godot 程序。Godot 对于C# 的支持只剩下一个,那就是Nuget 添加。
Godot VisualStudio外部编辑器设置

添加Nuget

Nuget 添加还是非常的容易的。我们直接添加一个最常用的序列化Nuget:Newtonsoft.Json

添加一个最简单的序列化输出

csharp 复制代码
 public override void _Ready()
	{
     var msg = JsonConvert.SerializeObject(new {
         name="小王",
         age = 15,
         sex = "男"
     }, Formatting.Indented);
     GD.Print($"{msg}");

 }

生产Csproj

记得这里要先在Visual Studio 里面生成之后再添加,因为Visual Studio在运行的时候会修改csproj 文件。

如果直接运行Godot 会报错,Nuget引用也会爆黄,对应的代码也会爆红。


运行成功

相关推荐
心前阳光16 小时前
Unity发布PC软件图标不能改变
unity·游戏引擎
an86950011 天前
unity如何在visual studio中打断点debug
unity·游戏引擎·visual studio
xcLeigh1 天前
Unity基础:使用Transform控制物体移动——Translate与position详解
unity·游戏引擎
FairGuard手游加固1 天前
Unity小游戏加密:global-metadata.dat与AssetBundle保护
游戏·unity·游戏引擎
狂人开飞机1 天前
11、UI系统
游戏引擎·godot
真鬼1231 天前
【Unity AI】Untiy链接cursor与MCP
unity·游戏引擎
郝学胜-神的一滴1 天前
C++11 工程级应用 10:减少拷贝,让容器跑得更快
服务器·开发语言·c++·游戏引擎·opengl
玖玥拾1 天前
Lua 基础语法(八) Unity Huatuo (HybridCLR)
开发语言·unity·游戏引擎·lua
狂人开飞机1 天前
10、相机系统
游戏引擎·godot
不吃凉粉2 天前
Unity与AS通信
unity·游戏引擎