LogoLogo
  • 🕴️ QUICK START GUIDE
  • DASHBOARD
    • Management
      • Add a new Game
        • Create a Game
        • Set-Up
        • Review Guidelines
      • Version control
        • Add a Build
        • Handle branches
        • Upgrade Versions
      • API Keys
    • NFT Collections
      • Add a Collection
      • Staking Support
    • Beta Codes
      • Create a Beta Code
    • Tournaments
      • Set Up
      • Create Tournament
    • In-App Purchases
      • Developer
        • Set up your Store
        • Submit Product
        • Client Integration
        • Handle Post-Payments
      • Payment Gateways
      • Review Guidelines
    • Elixir Invisible Wallet
      • Gas Manager
        • Create Gas Manager
        • Handle Balances
    • Reward Center
      • Game Quests
        • Add a Stat
        • Create a Quest
        • Test Your Quest
        • Submit your Quest
        • Update Progress
        • Review Guidelines
  • Elixir Gamer Services
    • 🏁Kick-off
    • Unity
      • Getting Started
        • Overview
        • Updates
          • GitHub
          • Unity Asset Store (Coming Soon)
      • Overlay
        • Overlay Actions
        • Event Simulator
          • SDK Events
      • Authentication
        • Desktop
        • Mobile
      • Reference
    • Unreal Engine
      • Getting Started
        • C++ Project
        • Blueprints Project
  • API
    • Elixir REST API
      • 🖥️Desktop Auth
      • 📱Mobile Auth
      • 🔐RSA Signature
        • 🔢C# Example
        • 🔢Node.js Example
      • 🧔User
      • 👾NFTs
      • 🏆Tournaments API
      • ❓Game Quests
    • How To
      • Link Elixir account to a game API account
Powered by GitBook
On this page
  • Overview
  • Initialization & Disposal
  • Integration

Was this helpful?

Export as PDF
  1. Elixir Gamer Services
  2. Unity
  3. Getting Started

Overview

PreviousGetting StartedNextUpdates

Last updated 1 year ago

Was this helpful?

Overview

The Elixir Overlay is a feature that allows developers to integrate features like NFT purchasing and friends chat seamlessly into their game.

While the overlay is provided by Elixir Launcher in-game automatically without any additional setup requirements, to integrate all the features of the overlay in-game, some setup is required.

Initialization & Disposal

The overlay event buffer will be automatically initialized by the SDK upon a call to PrepareElixir(apiKey).

The event buffer will remain initialized until application shutdown.

Integration

Here is a minimal example:

using Elixir;
using Event = Elixir.Overlay.Event;

public class TestOverlayController : MonoBehaviour
{
	// ... we will assume that a method Log is implemented that prints
	// text on-screen.

	// To initialize simply initialize the SDK by calling PrepareElixir
	public void Init()
	{
		ElixirController.Instance.PrepareElixir("your api public key here");
		
		// after the SDK is initialized, you can assign to the delegates
		Event.OnCheckoutResult += HandleCheckoutResult;
		Event.OnOpenStateChange += HandleOpenStateChange;
	}
	
	private void HandleOpenStateChange(bool isOpen)
	{
		Log($"MOpenStateChange: {isOpen}");
	}

	private void HandleCheckoutResult(bool success, string sku)
	{
		Log($"MCheckoutResult: {success}");
	}

}
Elixir Overlay - Getting Started
Drawing