Unity Plugin
Native Unity SDK for seamless game integration.
Installation
- Open Unity Package Manager
- Add package from git URL:
https://github.com/aethex/unity-sdk.git - 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!");
};
}
}