OnSwipe

Description

using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    void OnSwipe(int playerId, string elementName, Vector2 direction)
    {
        Vector3 fromSwipe = new Vector3(direction.x, 0f, direction.y);

        Debug.LogFormat(
            "Player {0:D} has swiped '{1:G}'.",
            playerId,
            elementName
        );

        // Move object
        transform.Translate(fromSwipe * Time.deltaTime);
    }
}

Gets called when a swipe field input on a players controller is registered. See VInput for a more common input handling.

 

playerId The player identifier.
elementName The name identifier of the registered swipe field.
direction The direction representing the swipe.