Xerial
  • Intro
    • ⚡Introduction
    • 🏁Getting Started
    • ℹ️Before We Start: Important
  • 👷Build
    • Build Your Account
    • Create Your Assets
    • Inventory
    • Marketplace
    • User Flow
    • Best Practices
      • Attribute Guide
        • Attribute Use Cases
  • ☄️Xerial APIs
    • 🗝️API Authorization
    • 🛅Wallet API
      • Getting Started
      • Custodial Wallets
        • Create User
        • Create Wallet
        • Get Wallets
      • Wallet Management
        • Get Chain Native Currency Balance
        • Get Supported ERC20 Tokens Balances
        • Get Project Inventory
      • Transaction Proccessing
        • Transfer Xerial NFT
        • Transfer Chain Native Currency
        • Transfer ERC20 Token
        • Primary Purchase Xerial NFT
        • Secondary Purchase
        • List Xerial NFT
        • Delist Xerial NFT
        • Execute Custom Transaction
      • Errors Handling
        • Authentication Errors
        • Wallet Management Errors
        • Transaction Proccessing Errors
    • 🛒Marketplace API
      • Get Listed NFTs
      • Get Community Listed Items
      • Get Collections
      • Get Project Data
    • 🖼️NFT API
      • NFT Drop
    • 🌐Xerial Global Wallets
      • Get User Wallet Info
      • Get Global Inventory
      • User Authorization
      • Logout
  • 🛠️Xerial SDK
    • Wallet SDK
  • 🏎️Gaming Toolkit
    • 🕹️Xerial Unity SDK Guide
      • ⬇️Installation
      • ⚙️Configuration
      • Xerial Services
        • Set Up Xerial Services
        • Service Managers
          • Session Manager
          • Wallet Manager
            • UserData Class
              • Account Class
              • Wallet Class
              • Creating UserData Class
          • Inventory Manager
            • NFTs
              • Metadata
              • Attributes
            • NFTInventory Class
            • Creating NFT Inventory
          • MarketPlace Manager
    • Unreal Engine SDKs
Powered by GitBook
On this page
  • Initialization
  • Configuration
  • Environment
  • API URLs
  • Wallet URLs
  • Blockchain Selection
  • Properties
  • Initialization
  1. Gaming Toolkit
  2. Xerial Unity SDK Guide

Xerial Services

The XerialServices script is a Unity component designed to facilitate interaction with Xerial services within Unity projects.

Initialization

To use the XerialServices script in your Unity project, follow these steps:

using UnityEngine;

namespace Xerial
{
    public class XerialServices : MonoBehaviour
    {
        public static XerialServices instance;
        
        void Awake()
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
            
            sessionManager = new SessionManager();
            walletManager = new WalletManager();
            inventoryManager = new InventoryManager();
            marketPlaceManager = new MarketPlaceManager();
            socialRedirecter = new SocialRedirecter();

        }
    }
}

Configuration

Environment

The Enviroment enum allows you to specify the environment for interacting with Xerial services. It includes the following options :

  • development: Development environment.

  • staging: Staging environment.

  • production: Production environment.

The environment can be set via the Unity Inspector or through script.

API URLs

The apiURL property retrieves the API URL based on the selected environment. The URL is automatically configured according to the environment specified.

Wallet URLs

The walletURL property retrieves the wallet API URL based on the selected environment.

Blockchain Selection

The Blockchain enum enables you to select the blockchain network for Xerial services. It includes the following options and any EVM compatible:

  • Polygon

  • Telos

  • Kroma

The selected blockchain can be accessed via the Chain property, which returns the corresponding string representation of the blockchain.

Properties

  • ProjectId: Retrieves the project ID associated with the Xerial services.

  • StudioAddress: Retrieves the studio address configured for the project.

  • Domain: Retrieves the domain associated with the project's website.

Initialization

The XerialServices script initializes necessary components upon Awake, ensuring proper functionality throughout the Unity project.

PreviousConfigurationNextSet Up Xerial Services

Last updated 1 year ago

🏎️
🕹️