我使用了 spine-godot, 具体步骤如下

  1. 下载该页面中windows支持c#的编辑器
    https://zh.esotericsoftware.com/spine-godot page
    Godot 4.2.2(支持C#)
    Windows版编辑器
    2.然后创建了新项目,接着关闭打开项目目录按照下面的操作进行操作
    3.打开新建的项目根目录,新建一个名为godot-nuget的文件夹
    4.复制以下文件到godot-nuge文件夹内
    GodotSharpEditor.<version>.snupkg
    Godot.NET.Sdk.<version>.nupkg
    Godot.SourceGenerators.<version>.nupkg
    GodotSharp.<version>.nupkg
    GodotSharp.<version>.snupkg
    GodotSharpEditor.<version>.nupkg
    5.在项目根目录下新建一个名为nuget.config的文件, 其内容如下:
    <configuration>
    <packageSources>
    <!-- package source is additive -->
    <add key="godot-nuget" value="./godot-nuget" />
    </packageSources>
    </configuration>
    
    下面问题来了,我打开了刚刚的那个项目,然后新添加了一个 SpineSprite节点,然后给这个节点添加了一个c#脚本,接着我用rider打开这个脚本,项目加载完之后,rider编辑器会提示:Cannot resolve symbol 'SpineSprite'
    我是操作有问题还是什么情况?
    
    下面是新建脚本的代码
    using Godot;
    using System;
    
    public partial class MySpineSprite : SpineSprite
    {
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
    }
    
    // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(double delta)
    {
    }
    }
    
Related Discussions
...

根据你提供的步骤和问题描述,似乎你已经正确地设置了项目,但在使用 Rider 编辑器时遇到了 Cannot resolve symbol 'SpineSprite' 的问题。以下是一些可能的解决方案:

  1. 确保 NuGet 缓存已清理
    确保你已经清理了 NuGet 缓存,因为官方的 Godot C# 程序集可能会与 Spine 版本冲突。你可以通过删除 $USER_HOME/.nuget 目录中的缓存来清理 NuGet 缓存。

  2. 检查 NuGet 配置
    确保 nuget.config 文件正确配置,并且 godot-nuget 目录中的文件版本与 Godot 版本匹配。你的 nuget.config 文件内容应该如下:

       <configuration>
           <packageSources>
               <add key="godot-nuget" value="./godot-nuget" />
           </packageSources>
       </configuration>
  3. 重新加载项目
    在 Rider 中重新加载项目,确保 Rider 能正确识别和加载所有依赖项。

  4. 检查 C# 脚本的命名空间
    确保你的 C# 脚本文件名和类名匹配,并且类名与文件名一致。例如,如果文件名是 MySpineSprite.cs,则类名也应该是 MySpineSprite

  5. 确保正确引用 Spine-godot API
    确保你在项目中正确引用了 Spine-godot 的 API。你可以尝试在脚本中添加以下命名空间引用:

       using Spine;
       using Spine.Unity;
  6. 检查 Godot 项目设置
    确保在 Godot 项目设置中启用了 C# 支持,并且项目正确配置了 C# 环境。

如果以上步骤都无法解决问题,请尝试重新下载并配置 Spine-godot 运行时,确保所有文件和配置都正确无误。

    Spinebot 很感谢你的答复,我刚刚翻帖子的时候也发现了这个方案,建议这个问题可以加到安装页面上,作为注意事项,
    我根据其他前辈的方法,进行如下操作就可以了。
    这个可能是你使用的NuGet的包的问题,我也遇到了一样的问题
    把c:\Users\用户名.nuget\packages\文件夹里godot开头的4个文件夹删掉;
    再启动Godot项目,让他重新安装nuget包就可以了

    Spinebot
    顺便还想跟您咨询一下,godot4.2.2需要特定的spine版本导出的才可用吗?我用3.8的导出spine-json文件或者skel文件在godot里面显示一个X,加载不到节点上。

      Jackie The version of the Spine runtime and the version of the Spine editor that exports the skeleton must always match. Therefore, when using the latest spine-godot build, you must use the skeleton data exported from Spine 4.2. spine-godot can only go back to 4.1, so it cannot read skeleton data exported from Spine 3.8.

        Misaki 所以现在如果使用spine-godot,只能固定的选择4.1.4或者4.2.2,然后搭配对应的spine版本4.1.1和4.2.2导出的文件才可以使用,任何其他版本不管向上还是向下,都不兼容对吧?

          Jackie Sorry for the late reply! Actually, no, because the version of the spine-godot runtime and the version of Godot may not match. For example, the spine-godot documentation page lists Godot 3.5.3, Godot 4.1.4, and Godot 4.2.2, but these are all the latest builds that are compatible with Spine 4.2. If you want to use the skeleton data exported from Spine 4.1, you will need to select the 4.1 branch on the spine-runtimes repository on GitHub and clone it, then build the Godot editor binary using our Bash shell script. Please see the documentation for detailed instructions.