I'm working on a De-Spaghettifying pass over my code base, and I'm finding a situation in which it'd be quite nice to be able to split a class across multiple files. I'm divying out the project into "Modules" that have a strictly one-way data access through the use of asmdefs. For the sake of demonstration, we have Core, Selection and MeshParser. Core has no dependencies on anything and contains all of the completely standalone, while both Selection and MeshParser reference Core, but not each other.
I have a script, FooterTooltip that updates a UI text with the following information: Where the camera currently is, the element you have selected (if one is selected), and the Facility Mesh you're inside of (if one is loaded). This code touches all three things - the camera controls are part of Core, you can only select an element if Selection is included, and there's only facilities loaded if MeshParser is included.
Currently, the script just runs Update to look for that information, and if it has changed, it modifies some UI Text. I know partial exists to basically split a class across multiple files and when it compiles, they fuse into one big Voltron-class containing everything, but I'm not sure how to get them all to run something in Update. I don't think I can just put Update in each of them and expect them all to run (and them running in an arbitrary order could clobber the data instead of checking them in order). I could pretty easily make each one a separate function, but how would I call the functions only if they're included, without needing to reference those other assemblies?