Get started with your unity project in minutes!
Download the SDK from the link below
Elixir Unity

Quick start guide

1. Download the package and import it into your project.

Unity - Import a package

2. Before the game starts call to Elixir.ElixirController.StartElixir( “APIKey”, “GameID” ) somewhere in xdsyour code; you will need an APIKey and a GameID, you can take them from the Elixir Backend.

You might need a new scene for this.

3. Wait until Elixir.ElixirController.isReady equals true and start your game

Unity - Start your game

4. To ask for the balance of the user, use Elixir.ElixirController.balance. You can set a callback using Elixir.ElixirController.OnBalance += (balance)=>{}; it will be called every time balance is modified.

5. To add Satoshis to the user, call to Elixir.ElixirController.BalanceAdd(amount);

6. To subtract Satoshis to the user, call to Elixir.ElixirController.BalanceSubtract(amount);

7. You can save on the cloud all the data inside the structure UserData (Assets/Elixir/UserData) calling to Elixir.ElixirController.Save();

Mind to keep your UserData class modifications if you will update the SDK.
Unity - Save UserData
Last modified 13d ago
Export as PDF
Copy link