Click or drag to resize

Method

Method

The component for adding virtual method to the parent component.

Contents
Overview

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.

Screenshot999999612.png
How to create

First, let's create Method object inside scene object.

Screenshot999999604.png

Set method name in the appeared window.

Screenshot999999605.png

In the created method, nested Flow Graph object will appear. One can open its editor clicking Editor option in a context menu.

Screenshot999999606.png

Flow Graph Editor which method body:

Screenshot999999607.png

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.

Screenshot999999608 2.png

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.

Screenshot999999609 2.png

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.

Screenshot999999612 2.png
Method call example

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.

Screenshot999999613 2.png

After that a new graph with event handler will be created.

Screenshot999999614.png

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.

Screenshot999999621 2.png

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.

Screenshot999999617 2.png

That's it. Now you can test if it works by running Player by clicking Play button in Ribbon.

Screenshot999999618.png
Properties
Name Description
Body The body of the method.
See also
PropertyMember Parameter