Search Results for

    Show / Hide Table of Contents

    Custom Events

    For all the events not handled natively in Surfer, we can use CustomEvents : events that we send to Surfer in order to let SUElementCanvas/SUElementsToolkit handle them.

    Animator

    An example of custom events can be done with the Animator.

    Basically :

    • let's add the component SUAnimatorBehaviour to an animator state machine

    • select if the behavior should run on the Animator State Enter or Exit mode

    • create an action SendCustomEvent and choose an event from the dropdown list

      Image

    • add SUElementCanvas to whatever scene object (for UIToolkit setup a SUElementsToolkit component and add a new element data) and , as event , select MyCustomEvent and then choose the event name chosen in the step above

    Now , you can react to an Animator State Enter or Exit event as you wish.

    LeanTouch

    An example of custom events can even be LeanTouch.

    Basically :

    • let's add the component LeanFingerTap to a scene object
    • let's add to the same object the component SUAction : now create a SendCustomEvent action and choose an event from the dropdown list
    • in the public event OnWorld of LeanFingerTap , drag the SUAction component in it and select the Play method

    Image

    • add SUElementCanvas to whatever scene object (for UIToolkit setup a SUElementsToolkit component and add a new element data) and , as event , select MyCustomEvent and then choose the event name chosen in the step 2

    Now , you can react to a LeanTouch event as you wish.

    In This Article
    Back to top Copyright © 2021 ATStudio