简体   繁体   English

在Unity3d游戏中使用/处理比特币

[英]Using/handling bitcoin in Unity3d game

I need to handle bitcoin in my unity project 我需要在我的统一项目中处理比特币

I tried to install some nuget packages to support that 我试图安装一些nuget软件包来支持

like this for example : https://github.com/blockchain/api-v1-client-csharp 例如: https : //github.com/blockchain/api-v1-client-csharp

but I always get this error 但我总是得到这个错误

Could not install package 'BlockchainAPI 2.0.0'. 无法安装软件包“ BlockchainAPI 2.0.0”。 You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. 您正在尝试将此软件包安装到以“ .NETFramework,Version = v4.0”为目标的项目中,但是该软件包不包含任何与该框架兼容的程序集引用或内容文件。 For more information, contact the package author. 有关更多信息,请与软件包作者联系。

unfortunately - no current unity3d plugins that support bitcoin yet 不幸的是-目前尚无支持bitcoin的unity3d插件

any suggestions , solutions ? 有什么建议,解决方案吗?

The plugin is using .NET version that is > Unity's supported .NET version. 插件使用的是.NET版本,即> Unity支持的.NET版本。

The easiest solution I know about is to download the project directly from the link you posted.Delete any file that is NOT a C# file( .cs ). 我知道的最简单的解决方案是直接从您发布的链接下载项目。删除不是 C#文件的任何文件( .cs )。 Extract those folders with the remaining files and put them in your Unity project. 提取带有其余文件的文件夹,并将其放入Unity项目中。 Now look for errors. 现在寻找错误。 If you find any script with an error or script that uses C# 4 classes, modify it and fix the errors by hand. 如果找到任何带有错误的脚本或使用C#4类的脚本,请对其进行修改并手动修复错误。

This is easier than trying to implement your own bitcoin API from scratch. 这比尝试从头开始实现自己的比特币API容易。

NOTE : The only reason I recommend this method is because I looked inside the project and there were no DLL files inside it. 注意 :我推荐此方法的唯一原因是因为我查看了项目内部,并且其中没有DLL文件。 So it is possible to port it if there is no DLL file in the API. 因此,如果API中没有DLL文件,则可以移植它。 Assuming there were DLL files compile with C# 4 , then that would be a problem. 假设有DLL文件使用C#4编译,那将是一个问题。

There's a beta edition of Unity that now supports a newer Mono version, which can let you compile .NET 4.5.2 (or older) projects. 现在有一个Beta版的Unity ,现在支持更新的Mono版本,可以使您编译.NET 4.5.2(或更旧的)项目。

I recommend you Nicolas Dorier's NBitcoin library for this then. 我建议您为此使用Nicolas Dorier的NBitcoin库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM