Theme switcher

Overview & Getting Started

Welcome to Haxelo SDK documentation, this will guide you to quickly integrate and utilize the SDK functionalities within your games.

Basics

Lets get started



Haxelo SDK Methods

In the project, there is sample initialization script that will show you how you can initilize Haxelo Session and use all of the methods.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 using System.Collections; using System.Collections.Generic; using UnityEngine; using haxelo; public class DemoScript : MonoBehaviour { // Start is called before the first frame update void Start() { //Initialize Haxelo Session by passing accurate data UserData data = new UserData("Female", 25); Haxelo.Initialize(data, false); //Set Target Camera Haxelo.setTargetCamera(Camera.main); //Track magnifier opens to pause the game Haxelo.onMagnifierOpen.AddListener(delegate { Haxelo.Log("Magnifier open event!"); Time.timeScale = 0; }); //Track magnifier opens to unpause the game Haxelo.onMagnifierClose.AddListener(delegate { Haxelo.Log("Magnifier Close event!"); Time.timeScale = 1; }); //Track Clicks to optionally reward user Haxelo.onLinkClick.AddListener(delegate { Haxelo.Log("Link Click event!"); Time.timeScale = 1; }); } //optionally Track player activity private void Update() { Haxelo.Log($"Player Activity {Haxelo.isPlayerActive()}"); } }

Initialize Method

Haxelo.Initialize(UserData data, bool userConsent)

Initializes the Haxelo SDK with user data and consent preferences.

  • Parameters:
  • UserData data – Contains user demographic information:
    • string gender – Can be "Male", "Female", "Non-binary", or empty.
    • int age – Any numeric value or empty.
  • bool IAP Status– Indicates whether the user has made an in-app purchase in your game.

1 2 UserData data = new UserData("Female", 25); Haxelo.Initialize(data, false);

Camera Configuration

Haxelo.setTargetCamera(Camera object)

Sets the camera that user is looking with at given moment .

  • Use case Required for proper measurement for impressions Haxelo.
  • Parameters: Camera object – The main game camera.

1 Haxelo.setTargetCamera(Camera.main);

Event Listeners

Haxelo provides event listeners for various interactions.

onMagnifierOpen Event

Haxelo.onMagnifierOpen

Triggered when the magnifier opens.

  • Use Case This can be used to pause the game when the magnifier opens to prevent gameplay distractions.
1 2 3 Haxelo.onMagnifierOpen.AddListener(delegate { Time.timeScale = 0; // Pause the game });

onMagnifierClose Event

Haxelo.onMagnifierClose

Triggered when the magnifier closes.

  • Use case This can be used to resume gameplay after the player finishes using the magnifier.
1 2 3 Haxelo.onMagnifierClose.AddListener(delegate { Time.timeScale = 1; // Resume the game });

onLinkClick Event

Haxelo.onLinkClick

Triggered when a user clicks on an in-game ad link.

  • Use case This can be used to reward users when they interact with ad units, making ad engagement more valuable.

1 2 3 Haxelo.onLinkClick.AddListener(delegate { // Grant reward or other in-game benefits });