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.