How to Integrate the Steem API with Unity 3d

in #unity6 years ago

For a client I had to display geo tagged content from steam in a XR browser made in Unity. When I first tried this I came across some helpful info, but thought I would put the steps down here that I had to complete to achieve this.

So here is what you have to do if you want to use the Steem api in a Unity or for that matter a .net project. Are you buckled in and ready for your flight :) ?

These instruction assume you already have a project setup, I'll not bore you with how to do that.

  1. Go to github and download the Steem .net API https://github.com/VIM-Arcange/Steem.NET
  2. Extract the cjson.cs, csteemAPI.cs,csteemd.cs,csteemwallet.cs and cwebsockets.cs files into your assets/scripts project folder
  3. From the Unity asset store import the JSON.net for unity https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347
  4. Now in Project->BuildSettings->Player Settings change the scripting runtime version level of your project from 3.5 to 4.x, this requires a restart.
  5. Once Unity has restarted you will get the error - CSteemWallet.cs(555,3): error CS1525: Unexpected symbol `arrParams'. It's missing a semi-colon, so open it in your code editor and add the ';' after arrParams. Save and the error should be gone
  6. Open CSteemWallet.cs, and double click CONSTRUCTORS, then change "127.0.0.1" to "https://api.steemit.com" and "nPort = 8091" to "nPort = 443". Do the same in CSteemd.cs.
    7.Open CWebsockets.cs, and double click CONSTRUCTORS, then change "ws://node.steem.ws" to "https://api.steemit.com"

Your now done, and can interact with the steem blockchain.

In the next post I'll write classes to help you interact with the blockchain. Hope this helps

All the best
Chris

Sort:  

Hey @chrisbanwell. Very interesting. Will this series go on?

Greetings!

Thank you very much for this tutorial. It's late and my upvote does nothing meaningful to show it, but thank you very, very much. I have been looking for this in a long, long time.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 59774.28
ETH 2422.19
USDT 1.00
SBD 2.44