Creating Addons
To create your own modules you can inherit from the TabletModule class.
For best results dont call your initial functions on Start(), instead use OnInitialize().
Making Addons Available on the Main Script
The main scripts loads its modules from 2 ScriptableObjects, the AvailableModules one holds the prefabs that will be added, and the AvailableCategories holds configurable categories using ModuleNames.
It is not needed to add your module to AvailableCategories, it will appear under Uncategorized if none was found.
Examples
Simple Initialization Check
public SomeFunction(){
if (!Initialized)
{
tablet.notificationSystem.CustomLog("MyModule >> Module not initialized yet!");
return;
}
// rest of the code...
}
We use tablet.notificationSystem.CustomLog instead of Debug.Log to add support for VUdonLogger and respect the user debug settings.
Simple Permission Check
[SerializeField]
string[] permissionTags;
public SomeFunction(){
if(!tablet.CheckAccess(permissionTags)) return;
// rest of the code...
}
The tablet handles the missing permission error message.
Simple Bypass Check
In this example target is a VRCPlayerApi variable representing the player we want to check the bypass for.
[SerializeField]
string[] bypassTags;
public SomeFunction(){
if (bypassTags != null && bypassTags.Length > 0 && tablet.CheckAccess(bypassTags, target, true))
{
tablet.notificationSystem.CannotFreeze();
Debug.Log("[<color=#DF5926>Admin Tablet</color>] >> Target has bypass tags! Cannot freeze.");
return;
}
// rest of the code...
}