Bolt (Unity < 2021.1)
Let’s see how to use a Surfer Action (OpenState for example) with Bolt.
What we have to do in our graph is :
-Use the Unit Surfer.OpenState
-Get the Instance of the Surfer Singleton in order to have a target object as a caller
-Add a NULL unit to CustomData if we don’t pass any our custom variable to the event/action (remember : customData is params
)
Like this
Event Listener
First of all, go to Unity->Preferences->Surfer , select Bolt under the section Integrations
and then click Save And Recompile
.
In order to receive a SUElementCanvas Event in Bolt we must do as follows :
- add
SUElementCanvas
to a scene object and then create a new event - then, in the graph of the object, add a
CustomEvent
unit , insert the name related the event you want to listen to and run the logic you want - as parameter, you have 1 Boolean that tells you if the event was run
OnSuccess
orOnFail
The name of the event must be equal to the name of the SUElementCanvas event without the words before the first _
, for example :
- if the event is
State->MyStateEnter
, in the CustomEvent unit you must writeMyStateEnter
- if the event is
Input->NewInput->OnAction
, in the CustomEvent unit you must writeNewInputOnAction
- if the event is a Surfer
CustomEvent
,in the CustomEvent unit just write the name of it