API Reference
Complete reference documentation for the Pixidus SDK. Use this page to quickly look up method signatures, parameters, and return types.
PixidusSDK
The main entry point for all SDK functionality.
Initialization
PixidusSDK.Init(Action onSuccess, Action<string> onError = null)| Parameter | Type | Description |
|---|---|---|
onSuccess | Action | Callback invoked when SDK initializes successfully |
onError | Action<string> | Optional callback invoked on initialization failure |
Example:
PixidusSDK.Init(() => {
Debug.Log("SDK initialized");
}, (error) => {
Debug.LogError($"Init failed: {error}");
});Essentials Methods
GetLocalization
string PixidusSDK.GetLocalization()Returns the current localization/language code.
| Returns | Description |
|---|---|
string | Language code (e.g., “en”, “tr”, “fr”) |
GetStreamingAssetsUrl
string PixidusSDK.GetStreamingAssetsUrl()Returns the URL for accessing streaming assets.
| Returns | Description |
|---|---|
string | Base URL for streaming assets |
PixidusSDK.User
User authentication and profile management.
Methods
ShowAuthModal
void PixidusSDK.User.ShowAuthModal()Opens the authentication modal on the Pixidus website.
Only functional in WebGL builds. Logs a debug message in Editor.
GetUser
void PixidusSDK.User.GetUser(Action<PixidusUser> callback)Retrieves the current authenticated user.
| Parameter | Type | Description |
|---|---|---|
callback | Action<PixidusUser> | Callback with user data, or null if not authenticated |
Classes
PixidusUser
public class PixidusUser
{
public string id;
public string email;
public string display_name;
public string avatarUrl;
public int coins;
public List<PurchasedInGameItems> purchased_in_game_items;
}| Property | Type | Description |
|---|---|---|
id | string | Unique user identifier |
email | string | User’s email address |
display_name | string | User’s display name |
avatarUrl | string | URL to user’s avatar image |
coins | int | User’s coin balance |
purchased_in_game_items | List<PurchasedInGameItems> | User’s purchased items |
PurchasedInGameItems
public class PurchasedInGameItems
{
public List<string> persistent;
public List<string> one_time;
}| Property | Type | Description |
|---|---|---|
persistent | List<string> | Permanent items (skins, characters) |
one_time | List<string> | Consumable items (power-ups) |
PixidusSDK.Data
Cloud data storage with local fallback.
Methods
SetInt
void PixidusSDK.Data.SetInt(string key, int value, Action<bool> callback = null)Stores an integer value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | int | Integer value to store |
callback | Action<bool> | Optional callback with success status |
GetInt
void PixidusSDK.Data.GetInt(string key, int defaultValue, Action<int> callback)Retrieves an integer value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
defaultValue | int | Default value if key doesn’t exist |
callback | Action<int> | Callback with retrieved value |
SetFloat
void PixidusSDK.Data.SetFloat(string key, float value, Action<bool> callback = null)Stores a float value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | float | Float value to store |
callback | Action<bool> | Optional callback with success status |
GetFloat
void PixidusSDK.Data.GetFloat(string key, float defaultValue, Action<float> callback)Retrieves a float value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
defaultValue | float | Default value if key doesn’t exist |
callback | Action<float> | Callback with retrieved value |
SetString
void PixidusSDK.Data.SetString(string key, string value, Action<bool> callback = null)Stores a string value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | string | String value to store |
callback | Action<bool> | Optional callback with success status |
GetString
void PixidusSDK.Data.GetString(string key, string defaultValue, Action<string> callback)Retrieves a string value.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
defaultValue | string | Default value if key doesn’t exist |
callback | Action<string> | Callback with retrieved value |
RemoveItem
void PixidusSDK.Data.RemoveItem(string key, Action<bool> callback = null)Removes a specific data entry.
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key to remove |
callback | Action<bool> | Optional callback with success status |
ClearData
void PixidusSDK.Data.ClearData(Action<bool> callback = null)Removes all stored data for the current user.
| Parameter | Type | Description |
|---|---|---|
callback | Action<bool> | Optional callback with success status |
This permanently deletes all user data. Use with caution.
PixidusSDK.Analytics
Event tracking and analytics.
Methods
LogEvent
void PixidusSDK.Analytics.LogEvent(string eventName, string eventValue)Logs a custom analytics event.
| Parameter | Type | Description |
|---|---|---|
eventName | string | Event name/category |
eventValue | string | Event value/data |
Example:
PixidusSDK.Analytics.LogEvent("level_complete", "level_5");PixidusSDK.Ads
Ad integration for monetization.
Methods
RequestRewardedAd
void PixidusSDK.Ads.RequestRewardedAd(Action<AdProgress, bool> callback = null)Requests and displays a rewarded ad.
| Parameter | Type | Description |
|---|---|---|
callback | Action<AdProgress, bool> | Callback with ad progress and reward status |
Callback Parameters:
AdProgress progress- Current ad statebool rewarded-trueif user earned reward
RequestInterstitialAd
void PixidusSDK.Ads.RequestInterstitialAd(Action<AdProgress> callback = null)Requests and displays an interstitial ad.
| Parameter | Type | Description |
|---|---|---|
callback | Action<AdProgress> | Callback with ad progress |
Enums
AdProgress
public enum AdProgress
{
Started, // Ad has started playing
Finished, // Ad has finished
Error // An error occurred
}| Value | Description |
|---|---|
Started | Ad playback has begun |
Finished | Ad playback completed |
Error | Ad failed to load or play |
PixidusSDK.Purchasing
In-game purchases and transactions.
Methods
Purchase
void PixidusSDK.Purchasing.Purchase(string itemId, Action<bool> callback = null)Initiates a purchase for the specified item.
| Parameter | Type | Description |
|---|---|---|
itemId | string | ID of the item to purchase |
callback | Action<bool> | Callback with purchase success status |
GetAllPurchasableItems
void PixidusSDK.Purchasing.GetAllPurchasableItems(Action<List<PixidusPurchasableProductPreset>> callback = null)Retrieves all items available for purchase.
| Parameter | Type | Description |
|---|---|---|
callback | Action<List<PixidusPurchasableProductPreset>> | Callback with list of purchasable items |
GetPurchasedItems
void PixidusSDK.Purchasing.GetPurchasedItems(Action<List<PixidusProductPreset>> callback = null)Retrieves all items the user has purchased.
| Parameter | Type | Description |
|---|---|---|
callback | Action<List<PixidusProductPreset>> | Callback with list of purchased items |
Classes
PixidusProductPreset
public class PixidusProductPreset
{
public string id;
public string name;
public string description;
}| Property | Type | Description |
|---|---|---|
id | string | Unique item identifier |
name | string | Item display name |
description | string | Item description |
PixidusPurchasableProductPreset
public class PixidusPurchasableProductPreset
{
public string id;
public string name;
public string description;
public int price;
}| Property | Type | Description |
|---|---|---|
id | string | Unique item identifier |
name | string | Item display name |
description | string | Item description |
price | int | Price in coins |
Quick Reference Table
| Module | Method | Description |
|---|---|---|
| SDK | Init() | Initialize the SDK |
| SDK | GetLocalization() | Get current language |
| SDK | GetStreamingAssetsUrl() | Get streaming assets URL |
| User | ShowAuthModal() | Show login dialog |
| User | GetUser() | Get current user |
| Data | SetInt() | Store integer |
| Data | GetInt() | Retrieve integer |
| Data | SetFloat() | Store float |
| Data | GetFloat() | Retrieve float |
| Data | SetString() | Store string |
| Data | GetString() | Retrieve string |
| Data | RemoveItem() | Remove data entry |
| Data | ClearData() | Clear all data |
| Analytics | LogEvent() | Log analytics event |
| Ads | RequestRewardedAd() | Show rewarded ad |
| Ads | RequestInterstitialAd() | Show interstitial ad |
| Purchasing | Purchase() | Make purchase |
| Purchasing | GetAllPurchasableItems() | Get available items |
| Purchasing | GetPurchasedItems() | Get owned items |
Support
Need help? Our support team is here for you: