Getting Started
Requirements
- Unity 2019.3+
- MacOS, Linux, Windows
Install
- Open Unity
- Goto menu Window > Package Manager
- Press Add button
- Add package from git URL...
- Put this repo url:
git@github.com:Blade-Labs/unity-blade.git
Examples
- In Package Manager pick
Unity Blade SDK - Open package Samples tab
- Click import at
Example Blade usageitem - On Project navigator go to: Assets/Samples/Unity Blade SDK/0.0.1/Example Blade usage/Scenes
- Open
RunBladeExamplescene - Play
Add to existing project
To use BladeSDK you need to add reference to your .asmdef
- Select your project .asmdef file
- On Inpector tab go to
Assembly Definition References - Click on
+ - Select
BladeLabs.UnitySDK
Usage
Before using BladeSDK you need to create instance. Put arguments to constructor like in example. It initialize Jint engine instance and attach all required handlers to interact. Avoid using multiple instances of BladeSDK.
using BladeLabs.UnitySDK;
using UnityEngine;
namespace YourProject {
class YourProjectClass : MonoBehaviour {
private string apiKey = "ygUgCzRrs_yourDAppApiKey_5m8FjfPV3XVUeB";
private Network network = Network.Testnet;
private string dAppCode = "unitysdktest";
async void Start() {
BladeSDK bladeSdk = new BladeSDK(apiKey, network, dAppCode, SdkEnvironment.CI);
// After init you can call any public method, e.g.:
Debug.Log(
await bladeSdk.getBalance("0.0.346533")
);
}
}
}