简体   繁体   中英

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

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

but I always get this error

Could not install package '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. For more information, contact the package author.

unfortunately - no current unity3d plugins that support bitcoin yet

any suggestions , solutions ?

The plugin is using .NET version that is > Unity's supported .NET version.

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 ). Extract those folders with the remaining files and put them in your Unity project. 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.

This is easier than trying to implement your own bitcoin API from scratch.

NOTE : The only reason I recommend this method is because I looked inside the project and there were no DLL files inside it. So it is possible to port it if there is no DLL file in the API. Assuming there were DLL files compile with C# 4 , then that would be a problem.

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.

I recommend you Nicolas Dorier's NBitcoin library for this then.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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