The VIPE Unity SDK is designed to assist Unity developers in seamlessly integrating NFT avatars into their projects. The SDK provides a set of tools and interfaces within the Unity editor, making it straightforward to incorporate, manage, and interact with NFT avatars.

Now that you have followed the installation and configuration steps in the Getting Started page, you can start implementing in your projects the amazing features the VIPE Unity SDK provides.

Avatar Library Tool

The first thing we are going to do is take a look at the Avatar Library, which you can see in Tools/VIPE/Avatar Library:

Here we will see a gallery of thumbnails belonging to different NFT collections that contain free to use avatars, also called CC0 collections:

In this UI, we can also see different elements:

  • Load Owner button, which will display your owned avatars in the avatar gallery in the bottom of the Avatar Library window. This will only be available if you have previously logged in from the Settings Menu.
  • Load CC0 (Open source) button, displays all the free to use avatars in the avatar gallery.
  • Search Bar: This tool is useful for quickly locating a specific avatar by name. Partial matches are also accepted.

Clicking on the thumbnail of a collection will display avatar thumbnails in the avatar gallery below. Let's select, for example, the "CryptoAvatars" collection. A Gallery of free to use NFT avatar thumbnails will be displayed:

This menu provides the functionality to load avatars directly into the scene. When you click on one of the thumbnails, it will appear in the center of the scene:

The VRM avatar appears with several useful components attached to it, which make it really easy to integrate into your project, e.g. to walk using the controls in your keyboard. Depending on how you want to use these avatars, it is essential to assign the appropriate animator and other corresponding components to them

VIPE Unity SDK Scripts

The scripts that allow the previous Avatar Library Tool to work , as well as many other useful scripts can all be used in your applications. We will now go through where they are located in the project as well as what their main classes are, what they do and how they can be useful for your applications.

Scripts Locations

The main scripts that provide the SDK functionality can be found inside the Assets folder, more specifically in the VIPE_SDK/Scripts folder. Once you go to this folder, as you can see in the picture below, the scripts are divided into 4 folders:

It's worth noting that the example scene also contains scripts that can be useful and make use of the previously mentioned ones. If you want to know more about those scripts you can go to the Example Scene page.

We will now go through the main 4 folders to have an overview of what they contain.

Cross Platform Input Scripts

The Cross Platform Input Scripts are designed to provide a flexible and easy-to-use input system for Unity projects. These scripts facilitate input handling across various platforms, ensuring a consistent user experience regardless of the device.

Editor Scripts

Here are the scripts that power the Avatar Library Tool, previously mentioned at the start of this page.

Below is a summary table detailing the main classes and their specific roles:

Class NamePurposeKey Features
VipeMenuMain interface for VIPE settings in Unity EditorAPI key and wallet management, rendering pipeline configuration, community links, dynamic UI elements
AvatarLoaderGUIMain window for avatar loading and managementIntegration with VIPE services, dynamic UI for collection browsing, event handling and state management

Runtime Scripts

In the VIPE Unity SDK, the Runtime Scripts play a crucial role in managing the dynamic aspects of the application during runtime. These scripts include various functionalities, from simple UI animations to complex data handling and network communications.

One key component within this suite is the VIPE class, a central figure in handling avatar-related operations, from fetching and displaying avatar data to managing VRM models. Below, we provide a concise overview of its primary scripts and their functionalities:

Method NameDescription ParametersReturn Type
ImportVRMImports a VRM file from the given path.string pathGameObject
SetPaginationDataSets the pagination data for avatar browsing.string next, string prevvoid
IsSupportedFormatChecks if the image format is supported.byte[] imageBytesbool
GetAvatarsFetches avatars with optional query parameters.Action<Models.NftsArray> onAvatarsResult, Dictionary<string, string> queryParams, string walletTask
PrevPageFetches the previous page of avatars.Action<Models.NftsArray> onAvatarsResult, Dictionary<string, string> queryParamsTask
NextPageFetches the next page of avatars.Action<Models.NftsArray> onAvatarsResult, Dictionary<string, string> queryParamsTask
GetAvatarPreviewImageGets the preview image for an avatar.string imageUrl, Action onImageLoaded, Texture2D placeholderTextureTask
GetAvatarVRMModelDownloads and imports a VRM model.string urlVrm, Action<GameObject, string> onModelLoadedTask
GetNFTCollectionsFetches NFT collections.Action<Models.NftCollectionsArray> onCollectionsResultTask
FetchCollectionsPageFetches a single page of NFT collections.string url (optional)Task<Models.
GetAvatarsByURLFetches avatars from a specific URL with query params.string pageUrl, Action<Models.NftsArray> onAvatarsResult, Dictionary<string, string> queryParamsTask

Utility Scripts

In the VIPE Unity SDK, Utility Scripts are the behind-the-scenes tools that handle various essential tasks. They are not as front-facing as some of the other scripts but play a vital role in the overall functionality of the SDK. From managing API keys to creating custom UI controls and ensuring smooth camera follow mechanics, these scripts form an integral part of the SDK's utility layer. Here’s a quick summary of these key utility scripts:

Class NameDescriptionKey Functionalities
APIKeyConfigManages API key storage as a scriptable objectStores and saves API keys within the Unity Editor
CustomToggleControllerEnhances UI toggle functionalityCustomizes toggle appearance and behavior, manages UI events
CustomButtonProvides enhanced interaction for UI buttonsChanges button appearance on hover, customizes button behavior

Next, we recommend checking out the Example Scene.