Message Interop

Updated 3 days ago

Message passing between mods:

Use the Unity SendMessage function to send messages directly between different mods without depending on reflection or compile time APIs.

This will also work with non ZenMods if the target mod creates a receiving method on their root BaseUnityPlugin class with a matching function name.

A single argument can be passed as type object. It is up to the receiving method to interpret the argument and process it accordingly.

Syntax:

SendMessage("ModGUID::Function", arg, SendMessageOptions.DontRequireReceiver);

Example:

var icons = [sprite1, sprite2, sprite3];
SendMessage("ZenDragon.ZenHoverItem::UpdateIcons", icons, SendMessageOptions.DontRequireReceiver);