Unity SDK Integration Guide
This integration allows you to receive linked user data in VRChat Worlds. For example, you can use this to display your Supporters in your world, or to show the Discord roles of users. Or to lock certain features to only users with a specific Discord role.
Installation
- Edit your Server in the VRCLinking Server Seettings create new World in the Worlds tab.
- Import the VRCLinking SDK
- Create a new Empty GameObject in your scene.
- Add the
VRCLinkingDownloadercomponent to the GameObject. This component will download the latest version of your World data from the VRCLinking API anytime the world is loaded. - Log-in to the VRClinking Downloader component with your VRCLinking account and choose your Discord Server and the world you created in step 1.
This will automatically download the latest data upon loading into the world. By itself this will not do anything, you need to add other components that utilize the downloaded data. Either by creating your own components or by using the provided components.
Provided Components
Supporter Board
This component will display a list of your Supporters in the world. It will automatically update the list when the data is downloaded.
How to create your own components
You can create your own components that utilize the downloaded data by inheriting the VrcLinkingModuleBase class.
You can override the "OnDataLoaded" method to receive an event when the data is downloaded.
The base class also provides you with downloader which is the VRCLinkingDownloader component that you added to your GameObject in step 4. It has public methods and properties that you can use to access the downloaded data.
Public methods include:
TryGetGuildMembersByRoleNameTryGetGuildMembersByRoleNameTryGetGuildMembersByRoleIdTryGetGuildMembersByRoleIdTryGetFormattedGuildMembersByRoleNameTryGetFormattedGuildMembersByRoleIdTryGetAtlasDetail
Public properties include:
parsedDatawhich contains the parsed and uncompressed data from the API.