The Swipe Action system has been designed around the Android platform, to allow for swipe direction determination. Up, Up Right, Right, Down Right, Down, Down Left, Left, Up Left, Single Point and Undefined are the different detected directions. With this, you can manipulate your game world to react to the different swiping directions, the swiping is visualized with a trail renderer. These different manipulations can be applied within the provided PlayerController.cs class object. This class object in general, contains all the code relating to the specific MainPlayer functionality, that the script is attached to.
Included with this package, are various handheld based multi-touch input actions. Meaning, it is possible to use either the melee or ranged actions with finger swipes, while moving the MainPlayer with the Movement Controls. The Melee toggle activates the melee swiping functionality, when in this mode a finger swipe of a certain length makes the MainPlayer emit a slash in the direction of the swipe. The direction is determined based on the mid-point of the starting swipe point and ending swipe point. Similarly, the Ranged toggle activates the range swiping functionality. The length of the swipe determines the power of the emitted arrow when the swipe is released, the arrow will go in the direction of the ending swipe point. Finally, the Movement Controls allow for the movement of the MainPlayer. The player will move in the angle at which the finger is swiped across it.
This package also comes with both a 2D Orthographic scene, as well as a 3D Perspective scene. Showing examples of how the system works, as well as how to use it in either situation. Also, within the 3D Perspective scenarios, the MainPlayer will rotate around the Y-Axis depending on the movement directions.
Within the PlayerController inspector, various attributes can be changed. Such as the speed of the MainPlayer, whether Desktop Test Mode is enabled or not; this allows for the swiping to be simulated through Mouse Inputs. The Orientation changes the location of the gui elements to be in either a Portrait or Landscape perspective; this effects the melee and ranged toggle, as well as the movement controls. Finally, Reverse Orientation will mirror the gui elements across the selected Orientation.