ProtoFlux:Method Proxy: Difference between revisions

From Resonite Wiki
add link
Make the info better
Line 21: Line 21:
|}}
|}}
==== What are Method Proxies ====
==== What are Method Proxies ====
A method Proxy is an internal sync method call that is not normally exposed to users when using flux. This can however be pulled out when using the mod "ShowDelegates" from art0007i [https://github.com/art0007i/ShowDelegates], to do so, go into the inspector of any slot and you should see "---- SYNC METHODS HERE ----", clicking on that should reveal the internal calls the engine uses. 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.
Method Proxy is a node used to call a method from a component. Some components expose these methods by default such as [[Component:StaticTexture2D|StaticTexture2D]]. More hidden methods can be exposed when using the mod "ShowDelegates" from art0007i [https://github.com/art0007i/ShowDelegates], 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).
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).

Revision as of 20:31, 26 March 2024

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

Method Proxy is a node 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 "ShowDelegates" from art0007i [1], 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 function from the engine that is exposed and usable (presumed to be public functions and not private functions in the code [TODO: double check this]) 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".