ChestTracker
Tracks chest spawns and opens throughout the round. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:99-109
Fields
Total number of chests spawned in the current round. Incremented by
SpawnInteractablesPatches.Postfix_SpawnChests().Number of chests that haven’t been opened yet. Decremented by
TrackStatsPatches.Postfix_OnChestOpened().Methods
Resets both
totalChests and unopenedChests to 0. Called at the start of each round and when the player dies.Example usage
ShadyGuyTracker
Tracks ShadyGuy NPC spawns, interactions, and disappearances. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:112-124
Fields
Total number of ShadyGuys spawned. Incremented when
InteractableShadyGuy.Start() is called.Number of ShadyGuys the player has successfully interacted with. Incremented by
ShadyGuyPatches.Postfix_Interact().Number of ShadyGuys that have disappeared (timed out). Incremented by
ShadyGuyPatches.Postfix_Disappear().Methods
Resets
total, interacted, and disappeared to 0.Example usage
ChargeShrineTracker
Tracks charge shrine spawns and completion states. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:127-139
Fields
Number of charge shrines currently active (not yet completed). Incremented on spawn, decremented on completion.
Total number of charge shrines spawned this round. Incremented by
ChargeShrineStartPatch.Postfix().Number of shrines the player has interacted with (currently unused in main tracking).
Flag indicating whether a round is currently active. Used to control tracking during round transitions.
Methods
Resets
ActiveShrineCount and interacted to 0. Note: Does NOT reset total.Example usage
MoaiTracker
Tracks Moai shrine spawns and interactions. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:141-151
Fields
Total number of Moai shrines spawned. Incremented by
MoaiSpawnPatch.Postfix().Number of Moai shrines the player has interacted with. Incremented by
MoaiPatches.Postfix_Interact().Methods
Resets both
total and interacted to 0.Example usage
OverlayManager
Manages the on-screen GUI overlay that displays tracker information. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:37-95
Fields
Reference to the overlay GameObject. Null when no overlay exists.
Methods
Creates the overlay GameObject and attaches the
ChestOverlay component. If the overlay already exists, makes it visible. The overlay persists across scene loads via DontDestroyOnLoad.Hides the overlay by setting
overlayObject.SetActive(false). Does not destroy the GameObject, allowing it to be shown again later.Immediately destroys the overlay GameObject and sets
overlayObject to null.Performs safe cleanup of all tracking state:
- Hides the overlay (doesn’t destroy it)
- Resets all tracker classes
- Sets
Plugin.disableTracker = true - Sets
ChargeShrineTracker.IsRoundActive = false - Resets
GameManagerPatches.roundStarted = false
Example usage
Implementation details
TheCreateOverlay() method registers the ChestOverlay type with IL2CPP:
Plugin.cs:41-55
SafeCleanup() method is designed to never throw exceptions:
Plugin.cs:73-94
ChestOverlay
Unity MonoBehaviour component that renders the GUI overlay. Namespace:MEGABONK_SIMPLE_MODLocation:
Plugin.cs:154-240
Rendering
The overlay uses Unity’s immediate mode GUI (IMGUI) system. It renders:- Semi-transparent black background box
- White text with black shadow for readability
- Positioned at bottom-left corner (10px from left, 80% down screen)
- Size: 250x130 pixels
Displayed information
Plugin.cs:175-178
Lifecycle hooks
BothOnDisable() and OnDestroy() call OverlayManager.SafeCleanup() to ensure proper cleanup.