ProtoFlux:Method Proxy

From Resonite Wiki
Revision as of 11:46, 29 May 2024 by AmasterAmaster (talk | contribs) (Updated links.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method Proxy
*
Next
This could be anything
This could be anything
This could be anything
This could be anything
This could be anything
Method
null
CoreNodes

What are Method Proxies

The Method Proxy node is used to call a method from a component. Some components expose these methods by default such as StaticTexture2D. More hidden methods can be exposed when using the mod "Show Delegates" from Arti, to do so, go into the inspector of any slot and you should see "---- SYNC METHODS HERE ----", clicking on that should reveal the extra methods. Using your flux tool, grab the method you want, then open your context menu and select the option "Proxy". This will spawn out a node with any number of arguments depending on the method call you choose.

The arguments on the Method Proxy node will be depending on the type it wants and also can depend on how many inputs it wants. This makes it very difficult to document the thousands of variants of this node (and is unwise to list them here unless there is a good explanation for the individual listing).

Some common methods known to use Method Proxies are System.Action methods (actions that the engine will enact upon when called). Common inputs from Method Proxies are IButton, and ButtonEventData, both are not needed to still work.

What you can do with Method Proxies

You can use Method Proxies when you want to call an internal method from the engine that is exposed and usable (presumed to be public method and not private method in the code) from a defined input from a user (i.e. a button press). This is also an alternative way to do the same call compared to using the node version of it (i.e. Using the Play function instead of the Play Flux node). However there is not really an advantage to doing it this way unless you have a good reason for it.

One common use for this node is to help with Cloud Spawning, utilizing the method "OnImportFile" within the component "FileMetadata".

There is another node similar to this but returns data as well, called a Function Proxy.