设置关键帧和缓动技巧 - Spine小技巧 #6
November 1st, 2023
请观看我们最新一期的Spine小技巧视频!了解如何使用缓动并选择正确的设置关键帧技巧来改进您的工作流程!
November 1st, 2023
请观看我们最新一期的Spine小技巧视频!了解如何使用缓动并选择正确的设置关键帧技巧来改进您的工作流程!
October 16th, 2023
让我们来探索如何将Spine与Unreal Engine结合使用!了解如何通过blueprints或C++代码使用spine-ue4运行时的基本组件。
本视频以我们的上期视频为基础,展示了如何设置和使用spine-ue4组件。如果你想了解如何安装spine-ue4运行时,请观看上期视频: 开始使用spine-ue4
这个视频有帮助吗? 我们希望在 Spine论坛上听到您对这一视频的看法。
October 2nd, 2023
本文简要介绍了开始使用 C# 和 spine-godot 的步骤,以及它与使用 GDScript 有何不同。
你可以从spine-godot 运行时文档下载我们预构建的 Godot 4.1 编辑器并导出支持 C# 的模板二进制文件。请阅读那里的文档了解基本安装说明。
要使用支持 C# 的 Godot 编辑器二进制文件,你在设置新的 Godot 项目时需要执行一个额外步骤:
首先,使用下载的支持 C# 的 Godot 编辑器二进制文件创建一个新 Godot 项目。
如果 Godot 编辑器无法加载 .NET 运行时,启动时会出现以下错误消息:
如消息中所述,请从微软官方下载站点安装 .NET SDK 6.0 或更高版本,然后重启 Godot。
关闭 Godot 并打开你的项目文件夹。在根目录中,创建一个名为godot-nuget
的新文件夹。
将 Godot C# 程序集复制到godot-nuget
文件夹中。如果你使用的是 Windows 或 Linux,可在下载的 Godot 编辑器 ZIP 文件中找到程序集:
godot-editor-windows-mono.zip\GodotSharp\Tools\
godot-editor-linux-mono.zip/GodotSharp/Tools/
如果你使用的是 macOS:
Godot.app
文件,导航至 Godot.app/Contents/Resources/GodotSharp/Tools/
,选择显示包内容
,然后导航至 Contents/Resources/GodotSharp/Tools/
。将以下文件复制到你的godot-nuget
文件夹中:
GodotSharpEditor.<version>.snupkg
Godot.NET.Sdk.<version>.nupkg
Godot.SourceGenerators.<version>.nupkg
GodotSharp.<version>.nupkg
GodotSharp.<version>.snupkg
GodotSharpEditor.<version>.nupkg
<version>
取决于您下载的 Godot 版本,例如 4.1.1
。
最后,在项目的根目录中创建一个名为nuget.config
的新文件,其中包含以下内容:
这会将godot-nuget
目录配置为 NuGet 包的包源。不从 NuGet 包注册表获取官方 Godot C# 程序集,而是使用godot-nuget
目录中的程序集,其中还包含 spine-godot 运行时的 C# 绑定。
你现在可以在 Godot 中打开项目并使用 Godot 和 spine-godot C# API,而不是 GDScript!
以下是使用附加到 SpineSprite节点的 C# 脚本对一个 Spine 骨架设置动画的简单示例代码:
C#:
与使用 GDScript 编写的相同代码相比,除了 API 使用 PascalCase 并且根据 C# 代码约定需要在末尾添加分号之外,几乎没有什么区别。
GDScript:
在 GDScript 中,你可以使用 @onready
注释在函数外获取骨架。在 C# 中,你无法在类定义中调用 API,因此你必须在函数内获取它。以下是翻转骨架和排队动画的 C# 和 GDScript 代码的比较:
C#:
GDScript:
有关 API 如何从 GDScript 映射到 C# 的详细信息,请参阅Godot C# 文档。
要查看并试验这些 spine-godot 的 C# 示例:
spine-runtimes/spine-godot/example-v4-csharp/
文件夹,然后单击project.godot
文件将其打开。你可以在 FileSystem 停靠栏的examples
文件夹下找到使用 C# 的各种示例场景和脚本。
如果你在使用支持 C# 的 spine-godot 时遇到问题,请随时在 Spine 论坛上发布你的问题!
September 5th, 2023
We're happy to announce that our spine-godot runtime now supports programming using the C# language! You are no longer limited to GDScript. C# support lets you use a feature rich IDE and can greatly increase productivity for complex games.
Please note that currently C# support in Godot 4.x is available only for desktop operating systems. As the Godot team expands platform support, our Godot binaries and export templates will be updated accordingly.
To get started, please visit our spine-godot documentation page and download the latest Godot + Spine binary with C# support for your operating system. Currently we provide binaries for the latest Godot stable release, which is 4.1.1.
Once you have successfully installed the Godot binary, follow the C# project setup guide to either initiate a new project or convert an existing one to utilize C# and Spine-Godot.
For more information on this topic, check out our new blog post about setting up a C# project.
Congratulations! You are now ready to develop your Godot games with Spine and C#!
Discuss this blog post on the Spine forum!