Unity SDKOverview

Unity SDK

Use this section to review required setup functions and examples for the Unity SDK.

Refer to the Installation section for installation information.

Calling into Gamebeast from Unity

gamebeast_setup.cs
using UnityEngine;
using Gamebeast.Runtime;
 
public class GamebeastStarter : MonoBehaviour
{
    void Start()
    {
        GamebeastSdk.Init("abcd-efgh-1234-5678");
    }
}

SDK Methods

Init(apiKey)

→ void

This function must be called once to initialize the Gamebeast SDK. Attempting to call any other SDK method before calling Init will result in an error.

apiKey

string

The API key for the SDK.

Usage

GamebeastSdk.Init("abcd-efgh-1234-5678");

Accessing Services

After initializing the SDK, you can access various services provided by the Gamebeast SDK. Each service is accessible via a static property on the GamebeastSdk class.

Example: Accessing the Markers Service

var markersService = GamebeastSdk.Markers;
markersService.SendMarker("example_marker", new { value = 42 });