If you'd like to contribute to MultiGame, please open an Issue and submit a pull request.
Submissions should come in the form of a new component, and should follow conventions from similar files. For example, when writing new camera controllers, first review other camera controllers and other components it's likely to interact with.
MultiGame uses MessageManager.ManagedMessage to communicate with and call functionality on other components. This system allows MultiGame to interface with third-party systems without breaking functionality and without tight coupling, and it provides several advantages over delegates at a small performance cost.
Because of this convention, submissions relying on delegates for communication are likely to be rejected. If you need a delegate for some other purpose, such as global registry to a singleton, that usage is expressly permitted, but should not be used as an alternative to ManagedMessage unless implementation constraints require it, and the delegate is not directly exposed to the user (which can cause confusion)
- Messages are declared in the following format:
public MessageManager.ManagedMessage message; OnValidatemust be used to update the message GUI as follows:MessageManager.UpdateMessageGUI(ref message, gameObject);otherwise, the list of available messages will not be updated, leading to user frustration- Messages can be sent via the
MessageManageras follows:MessageManager.Send(message); - Please avoid calling
Sendevery frame from a large number of objects, because it is several times more expensive than a standard method call.
Example:
[Tooltip("What should we send when clicked?")]
public MessageManager.ManagedMessage message;
void OnValidate () {
MessageManager.UpdateMessageGUI(ref message, gameObject);
}
void OnMouseUpAsButton() {
MessageManager.Send(message);
}- All new component or system submissions must contain, at a minimum, in-editor documentation including a brief explanation of the component. These are created with
HelpInfopublic fields in the following format:public HelpInfo help = new HelpInfo(string text, [string videoLink]);wherevideoLinkis optional. - Public methods that are intended to be called using the
MessageManagersystem must haveMessageHelpdeclared in the following format:public MessageHelp methodHelp = new MessageHelp(string _messageName, string _text,[ int _argumentType, string _argumentHelp]); public void Method () { [...] - Public fields must have a
Tooltip,RequiredFieldAttribute, or other Editor hinting to allow users to quickly understand components and refresh prior knowledge.
When contributing changes, please limit machine learning use to code review and debugging purposes, and don't submit new features that have been "vibe-coded".
Use of documentation generators or other non-machine-learning automation systems is unrestricted.
MultiGame's Component Documentation at https://terpri.org/mgdoc is generated by Robin Templeton.