Not great at making docs but felt like I need to. Here's everything with some examples. In these docs, it is organized by namespace.
Note: If these docs are not up to date, all summaries of the mods are up-to-date, so your Visual Studio install can tell you what functions do.
- Description:
A class providing modded functionality from most Utilla forks. If Utilla is not installed, Cardboard will manage the modded room functionality itself.
To use it, subscribe a modded join function to delegates
ModdedJoinandModdedLeave. - Example:
using Cardboard.Classes; using BepInEx; public class MyGamemodeHandler : MonoBehaviour { bool inModded = false; public void ModdedJoin() => inModded = true; public void ModdedLeave() => inModded = false; public void Start() { CardboardModded.ModdedJoin += ModdedJoin; CardboardModded.ModdedLeave += ModdedLeave; } public void Update() { if (inModded) { // Do your modded stuff here } } }
CardboardHarmony is a decent handler for patching your mod. It is pretty simple to use and only takes a couple arguments.
-
Description: Patches the
BaseUnityPluginprovided and returns theHarmonyclass used to patch the plugin. -
Example:
[BepInPlugin("modauthor.modname", "Mod Name", "1.0.0")] public class MyMod : BasePlugin { Harmony thisHarmony; void Start() { thisHarmony = CardboardHarmony.PatchInstance("my.uuid"); } }
-
Overloads:
PatchInstance(string _UUID)
- Description:
Removes patches for the
_instanceofHarmony. - Example:
Harmony thisInstance; void OnEnable() => thisInstance = CardboardHarmony.PatchInstance(this); void OnDisable() => CardboardHarmony.UnpatchInstance(thisInstance)
Handles controller inputs.
-
leftPrimary
-
leftSecondary
-
leftGrip
-
leftTrigger
-
leftStick
-
rightPrimary
-
rightSecondary
-
rightGrip
-
rightTrigger
-
rightStick
- Description: Gathers the value of the
_inputType. - Example:
void Update() { if (Input.GetValue(InputType.rightPrimary)) { // stuff to do when the right primary is pressed // you couldn't have figured out how to use GetValue() without me // thank me for my services by starring the CardboardLib repository } }
Loads assets, big shocker
- Description: Loads GameObject
_namefrom the resource at_path. - Example:
GameObject myAsset = CardboardAssetLoader.Load("Resources/myassetbundle", "FooBarPrefab");
Handles mod installation checks
- Description: Checks if mod with UUID
_UUIDis installed. - Example:
if (CardboardBootstrap.Installed("me.mymod")) Debug.Log("Thank you very much!");