Welcome to the VIPE Unity SDK documentation. This comprehensive guide aims to help you seamlessly integrate VIPE's powerful features into your Unity projects. Whether you're looking to manage avatars or utilize blockchain-based assets, our SDK has got you covered.
We offer support for Unity versions 2021.3.12f1 and later
In this documentation, you'll find step-by-step installation instructions, feature explanations, and code samples to fast-track your development process. From setting up GIT and installing essential dependencies to customizing avatar settings and in-game menus, we cover it all. By the end of this guide, you'll be well-equipped to leverage the VIPE Unity SDK for enhanced user experiences and efficient project development.
So, let's dive right in and get started! For a quick and visual guide, you can also start by watching the video tutorial just below.
GIT is essential for accessing and downloading necessary libraries such as vrmshaders, gltf, univrm and vrm. Follow the steps below for proper installation:
- Visit the official GIT site to start the download.
Download Link: Git - Downloads
- Once downloaded, choose the version corresponding to your operating system and follow the installation instructions.
This installation will ensure that you do not encounter any issues when installing packages with GitHub URLs.
For the proper functioning of the plugin, it is necessary to have certain libraries that have already been mentioned previously.
- Access the official Unity VRM repository on GitHub to download and install the required dependencies.
Installation Link: UniVRM on GitHub
Finally, to integrate our VIPE package to your Unity project:
- Download the VIPE Unity SDK here
- Simply drag the package file into your project in Unity. Alternatively, you can open it directly, and you will be presented with a pop-up window that will guide you through the import process.
Before taking advantage of the features of this Plugin, it is essential to carry out its proper configuration. Follow the steps below to ensure proper integration:
Locate the menu in the top left task bar of your screen.
Select the 'Settings' option from the drop-down menu.
In the pop-up window, you will find a field requesting an API-Key. This code is essential to establish a connection to our services.
- If you do not already have an API-Key, click on 'Get API Key'. You will be redirected to a website where detailed instructions on how to obtain it are provided. Alternatively, you can go straight to the Authorization section.
- Once in possession of the key, enter it in the designated field. Use the icon to the right of the field to paste the API-Key if you prefer.
With these steps, you have completed the basic configuration of the Plugin. You will now be able to view the CC0 avatars in the sample scene.
To display and manage your own avatars in the Plugin, it is essential to establish a connection to your digital wallet. You can see a section where you will identify a field called 'Wallet Address'.
- Click on the 'Login to VIPE' button. You will be redirected to our web portal, where you will need to authenticate using your Metamask or WalletConnect wallet. Once the connection is established, return to Unity. You will notice that the 'Wallet Address' field will now be populated, indicating that the link has been success.
We recommend that you ensure that you keep your login details secure and manage your avatars with caution.
This menu allows you to adjust the VRM materials, ensuring their correct display in Built-in or URP modes.
- Project Render Pipeline: Reflects the current state of the engine configuration.
- VRM Configuration: Displays the active VRM configuration. Use the buttons below to adjust these settings, making sure they match the project settings.
It is crucial that both the Project and VRM states match to ensure optimal representation of the avatars.
This menu provides the functionality to load avatars directly into the scene. Depending on how you want to use these avatars, it is essential to assign the appropriate animator and other corresponding components to them.
The "Overview" menu is distinguished by its intuitive and functional structure:
- Load Buttons:
- Load Owned: Enables uploading avatars that are under your possession.
- Load Open source: Enables the loading of avatars that are offered for free.
- Search Bar: This tool is useful for quickly locating a specific avatar by name.
- Collection Filters: Facilitates the organisation and display of avatars, allowing you to filter them according to their respective collections. The collections displayed contain Open source avatars.
- Navigation between Pages: If the avatars presented exceed the capacity of a single page, use the "Next Page" and "Previous Page" buttons to navigate between the different avatar pages.
The in-game menu provides players with a simple interface to customise their in-game experience, offering multiple options for avatar selection and customisation. It is designed to be intuitive and easy to use, allowing players to easily navigate between the available options.
- Log In:
- This option allows players to access their account. Upon successful login, players can access the avatars they own on the platform.
- Start As Guest:
- Players who choose this option can play without logging in. It is a quick way to join the game, although it does not offer the personalised experience of having your own avatars.
- Upload Avatar:
- Players can upload a custom avatar from their device using this option. This is particularly useful for those who have a VRM avatar that does not exist within the platform and wish to use it in the game.
- Avatar Preview:
- The interface prominently displays a preview of the currently selected avatar. This gives players a clear view of how their character will look in-game.
- Avatar Collection Browsing:
- Players can browse various avatar collections. These collections feature CC0 (Open source) licensed avatars, ensuring a wide range of options for all players.
- Avatar Search Function:
- If players have a specific avatar in mind, they can use the search function. By entering the name of the avatar, they can quickly locate and select it.
- Upload Avatars via URL:
- As mentioned, players always have the option to upload an avatar that is in the cloud and possess the URL.
- ESC Functionality:
- Pressing the 'ESC' key provides dual functionality. It hides the avatar selection interface, allowing players to return to the game. In addition, it releases the mouse, allowing players to control their selected avatar.
VIPE script handles avatar management and interaction with the
3.1.1 Variables and Components:
- mainThreadDispatcher: Dispatcher to execute tasks in the main thread.
- NextPageUrl, prevPageUrl: URLs for paged avatar navigation.
- modelCreated: Event invoked when a model is successfully created.
3.1.2 Main Methods:
- GetAvatars(): Retrieves avatars from the API.
- PrevPage(): Navigates to the previous page of avatars.
- NextPage(): Navigates to the next avatar page.
- GetAvatarPreviewImage(): Gets a preview image of an avatar from a URL.
- GetAvatarVRMModel(): Download and load a VRM model from a URL.
- GetNFTCollections(): Retrieves all available NFT collections.
- DefaultQuery(): Provides a default set of query parameters.
- GetAvatarsByURL(): Retrieves avatars based on a specific URL.
MenuManager script manages the user interface and user interaction with avatars and collections.
3.2.1 Variables and Components:
- canvas, loginPanel, avatarsPanel: References to GUI components for navigation.
- loadVRM, nextPageBtn, prevPageBtn: Buttons for loading VRM models and navigating between avatar pages.
- messageEnableUI, avatarCardPrefab, collectionCardPrefab, loadingSpinner: References to gameObjects and prefabs used in the UI.
- scrollViewAvatars, scrollViewCollections: Scrollable areas showing avatars and collections.
3.2.2 Main Methods:
- LoadByURL(): Load a VRM model using a user-entered URL.
- CancelExistingTasks(): Cancels any existing asynchronous tasks.
- LoadAvatarUI(): Toggles the display between the login panel and the avatar panel.
- SetSearchField(): Sets the search field to execute a search query when the text changes.
- DebounceSearch(): Delays the execution of a search query and performs it after a specified delay.
- ExecuteSearch(): Execute a search query to load avatars based on the provided search criteria.
- LoadOwnVRMAsync(): Asynchronously loads the user's own VRM models.
- LoadOwnVRMButtonWrapper(): A wrapper to load the user's own VRM models.
CardAvatarController script is responsible for managing and presenting avatar specific information on a card.
3.3.1 Variables and Components:
- avatarName: Reference to the text component where the avatar name is displayed.
- vrmUrl: Stores the URL associated with the avatar's VRM model.
3.3.2 Avatar Data Set (SetAvatarData):
This method sets the avatar information on the card, including the name, the VRM model URL, and the action to perform when the card is clicked.
name: Avatar name.
vrmUrl: URL associated with the avatar's VRM model.
onClickCardBtn: Action to execute when the card is clicked.
3.3.3 Load Avatar Image (LoadAvatarImage):
Allows to load and display the avatar image on the card from a provided texture.
texture: The avatar image represented as a
CardCollectionController script manages and presents collection specific information on a card.
3.4.1 Variables and Components:
- imageCollection: Reference to the image component where the image of the collection will be displayed.
- textCollection: Reference to the text component where the name of the collection will be displayed.
3.4.2 Initialisation (Awake):
This method is automatically invoked when the object is instantiated. It initialises the references to the image and text components of the card.
3.4.3 Set Collection Data (SetCollectionData):
This method is invoked automatically when the object is instantiated.
Sets the collection information on the card, including the name, the URL of the associated VRM model, and the action to perform when the card is clicked.
name: Collection name.
vrmUrl: URL associated to the VRM model of the collection.
onClickCardBtn: Action to be executed when the card is clicked.
3.4.4 Load Collection Image (LoadCollectionImage):
Allows to load and display the collection image on the card from a provided texture.
texture: The collection image represented as a