Unity Plugin

Native Unity integration for games

Unity Plugin

Native Unity SDK for seamless game integration.

Installation

  1. Open Unity Package Manager
  2. Add package from git URL: https://github.com/aethex/unity-sdk.git
  3. Or download from the Asset Store

Setup

using AeThex;

public class GameManager : MonoBehaviour
{
    void Start()
    {
        AeThexSDK.Initialize(new AeThexConfig {
            ProjectId = "your-project-id",
            ApiKey = "your-api-key"
        });
    }
}

Authentication

public async void SignIn()
{
    var session = await AeThexSDK.Auth.SignIn(AuthProvider.Discord);
    Debug.Log($"Welcome, {session.User.DisplayName}!");
}

Multiplayer

using AeThex.Realtime;

public class MultiplayerManager : MonoBehaviour
{
    private Room currentRoom;
    
    public async void JoinRoom()
    {
        currentRoom = await AeThexSDK.Realtime.JoinRoom("lobby");
        
        currentRoom.OnPlayerJoined += (player) => {
            Debug.Log($"{player.Name} joined!");
        };
    }
}