The component for adding virtual method to the parent component.
Virtual method is being entirely created in the editor. Usually, the body of the method is created with Flow Graph Editor. This method isn't much differ from any other from engine's point of view. It can be called and it can have parameters.
Screenshot display method's body. Method outputs the value of the first parameter to the log (and into player's console). Below will be discussed how to create such a method.
First, let's create Method object inside scene object.
Set method name in the appeared window.
In the created method, nested Flow Graph object will appear. One can open its editor clicking Editor option in a context menu.
Flow Graph Editor which method body:
Next, one can add method parameters. Member Parameter object should be used to do this, which should be added to the method. This object have name, type and other parameters that can be customized. After parameters addition, those will appear in the Method Body node graph.
One can customize method's logic now. Let's add the output of the first parameter to the log (and to the player's console). To do that, drag&drop method Log.Info(string message) from Resources Window. Method can be found at All types\NeoAxis\Log.
Added object should have Flow Control property enabled, so it could be connected with other nodes. Next, one should connect Flow output of method body with Log.Info() node. Also, connect Parameter1 with parameter Message. Basically, that wraps up this method.
In order to give an example on how to call created method, let's create an event handler. Enabled Event scene event will be used, that is triggered after scene initialization.
First, select scene object, at Settings Window go to Events tab. Next, press desired event's addition button. In the appeared menu, chose Add handler to Flow Graph.
After that a new graph with event handler will be created.
Next, place node with our method call in the graph. In order to do that, press Show Members button in the Objects Window, find our method and drop in into editor's workspace.
Now, one should enable Flow Control property to be able to connect method's node to event handler's node. Customize Parameter1 mothod's parameter.
That's it. Now you can test if it works by running Player by clicking Play button in Ribbon.
|Body||The body of the method.|