Skip to content

3. Setup Unity

Child of the Beast edited this page Apr 14, 2023 · 6 revisions

Most of what you need has been made for you with prefabs and put into your Hierarchy's Context menu.
This doc will be going over how to set our prefabs up. If you'd like to make your own plugins for the prefab, please refer to "Making a Plugin".

Adding the prefab to your Scene

DisBridge's prefab is in your Hierarchy's Context menu.
What that means is you add them into your Scene as you would any other object.
When you right click to add a new object into your scene, you should see a new option at the bottom on your menu for UdonVR. (That menu is called a Context menu)
Going into that option, you should see a section for DisBridge.
Clicking on the option for DisBridge under that adds the prefab to your scene.
Just to clarify, the Context Menu path for the prefab is UdonVR/DisBridge/DisBridge

Setting up the Prefab

If you are using the free version of DisBridge, you can skip to Parts of a RoleContainer below for setup, as you wont have a JSON to import and will need to do a manual setup.

To initially setup the prefab, it is recommended to import your roles from the DisBridge bot.
All you need to do is to click the Parse from Json button in the bottom right of the editing tool.
(If you dont have the Json file to import, you can get it by running /guild-status in your server.)
All of your roles should now be in the editing tool.

After importing your roles, you'll need to do some minor edits.
To edit a role, all you need to do is click on the role, and it should expand to show all the options.
You'll need to go though each of your now imported roles and check mark what roles are and aren't support and staff roles.
The Is Supporter and Is Staff check marks are for generic checks. This is so if a plugin doesn't need to know what specific role you're in, and just needs to know if you're a staff member or a supporter.
A role can be both a supporter and a staff member. If you're just using DisBridge to edit a list of names, you dont need to mark any roles as supporters or staff. But it's still recommended to do so.

Other notable options would be Alternative Role Name, Role Icon and Manual Usernames.
You can read about what everything does in Parts of a RoleContainer below.

Parts of a RoleContainer:

Variables

Variable Description
Role ID This is what is used to match your roles in Discord to the roles used in Unity.
Role Name This is the name of the Role itself.
Role Alt Name This is the Alt Name of the role, generally this is a Singular name. Example being:
If the role was called Developers i would make the Alt name Developer.
Role Icon The Icon for plugins to use for the role.
Role Color The color for plugins to use for the role.
Manual Members This manually adds people to the role, and will include them when creating the lists. These users will also be used if your key fails to load, or if no key is used.
Manual members will also be used to test permissions in Editor. Duplicate users found in Manual Members will not be added to the total user list when pulling users from your key.
Is Staff This marks your role as a Staff role and will mark the role to be added to the generic Staff list.
Is Supporter This marks your role as a Supporter role and will mark the role to be added to the generic Supporter list.
Is Booster This marks your role as your Discord Booster role. You can only have one of these marked, and if you have multiples the PluginManager will use the first one it finds.

Color reference

Default Role Colors:

Discord role color reference

1abc9c 2fcc71 3498db 9b59b6 e91e63 f1c40f e67e23 e74b3c 95a6a6 607d8b
0F806A 208b4c 206694 71368a ad1357 c27c0d a84301 992d22 979c9f 546e7a

Server Booster Color: f47fff

Legacy

Manually setting up your RoleContainers

manual setup of your role containers is no longer needed in version 8.0+. The recommended way is to use the included editing tool.
This way is still needed for the Legacy version of DisBridge.

Roles are stored in objects called RoleContainers. Your RoleContainers are stored under your DisBrige PluginManager under -- Roles --.
There are 3 ways to add a new RoleContainer.
You can duplicate the current RoleContainer which will make a new one next to the current one. Or you can right click -- Roles -- and add a new RoleContainer found under /UdonVR/DisBridge/Parts/RoleContainer.
If you would like to add the prefab manually it's found in _UdonVR/DisBridge/Prefabs/Parts

The RoleContainer holds all of your roles information. They MUST be under -- Roles -- in the PluginManager and in the same order you have your roles setup as in Discord.
You can find your role order by running /Guild-status and can be re-ordered using /supporter-role reorder