{"id":407,"date":"2012-10-15T23:21:30","date_gmt":"2012-10-16T06:21:30","guid":{"rendered":"http:\/\/chazix-scripts.com\/?p=407"},"modified":"2012-10-23T18:25:33","modified_gmt":"2012-10-24T01:25:33","slug":"swipe-action","status":"publish","type":"post","link":"https:\/\/chazix-scripts.com\/?p=407","title":{"rendered":"Swipe Action"},"content":{"rendered":"<p><a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/swipe-action\/3uN\"><img loading=\"lazy\" class=\"size-full wp-image-408 alignleft\" title=\"SwipeActionIcon\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/post_icon.png\" alt=\"Swipe Action\" width=\"128\" height=\"128\" \/><\/a> The <a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/swipe-action\/3uN\">Swipe Action<\/a> system has been designed around the <strong class=\"variable\">Android<\/strong> platform, to allow for swipe direction determination. <a href=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_3.png\" rel=\"lightbox-407\"><img loading=\"lazy\" class=\"alignright  wp-image-414\" title=\"SwipeDirections\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_3-300x222.png\" alt=\"Swipe Directions\" width=\"200\" height=\"236\" \/><\/a>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 <strong class=\"variable\">PlayerController.cs<\/strong> class object. This class object in general, contains all the code relating to the specific <strong class=\"variable\">MainPlayer<\/strong> functionality, that the script is attached to. <!--more--><\/p>\n<p><a href=\"http:\/\/u3d.as\/content\/chazix-scripts\/swipe-action\/3uN\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/postbig.png\" alt=\"Swipe Action\" title=\"SwipeActionBigPic\" width=\"473\" height=\"388\" class=\"aligncenter size-full wp-image-427\" \/><\/a><iframe loading=\"lazy\" width=\"640\" height=\"390\" src=\"http:\/\/www.youtube.com\/embed\/R9VTIjKIcsI\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\nIncluded 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 <strong class=\"variable\">MainPlayer<\/strong> with the <strong class=\"variable\">Movement Controls<\/strong>. The <strong class=\"variable\">Melee<\/strong> toggle activates the melee swiping functionality, when in this mode a finger swipe of a certain length makes the <strong class=\"variable\">MainPlayer<\/strong> 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 <strong class=\"variable\">Ranged<\/strong> 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 <strong class=\"variable\">Movement Controls<\/strong> allow for the movement of the <strong class=\"variable\">MainPlayer<\/strong>. The player will move in the angle at which the finger is swiped across it.<\/p>\n<p><a href=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_5.png\" rel=\"lightbox-407\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_5-300x217.png\" alt=\"3D Perspective\" title=\"3DPerspectiveSwipeAction\" width=\"300\" height=\"217\" class=\"alignright size-medium wp-image-454\" srcset=\"https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_5-300x217.png 300w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_5-413x300.png 413w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_5.png 467w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>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 <strong class=\"variable\">MainPlayer<\/strong> will rotate around the <strong class=\"variable\">Y-Axis<\/strong> depending on the movement directions.<\/p>\n<p><a href=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_4.png\" rel=\"lightbox-407\"><img loading=\"lazy\" src=\"http:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_4-300x61.png\" alt=\"Player Controller Inspector\" title=\"PlayerControllerInspector\" width=\"300\" height=\"61\" class=\"alignleft size-medium wp-image-439\" srcset=\"https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_4-300x61.png 300w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_4-500x101.png 500w, https:\/\/chazix-scripts.com\/wp-content\/uploads\/2012\/10\/screenshot_4.png 511w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> Within the <strong class=\"variable\">PlayerController<\/strong> inspector, various attributes can be changed. Such as the speed of the <strong class=\"variable\">MainPlayer<\/strong>, whether <strong class=\"variable\">Desktop Test Mode<\/strong> is enabled or not; this allows for the swiping to be simulated through <strong class=\"variable\">Mouse Inputs<\/strong>. The <strong class=\"variable\">Orientation<\/strong> changes the location of the gui elements to be in either a <strong class=\"variable\">Portrait<\/strong> or <strong class=\"variable\">Landscape<\/strong> perspective; this effects the melee and ranged toggle, as well as the movement controls. Finally, <strong class=\"variable\">Reverse Orientation<\/strong> will mirror the gui elements across the selected <strong class=\"variable\">Orientation<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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, &hellip; <a href=\"https:\/\/chazix-scripts.com\/?p=407\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[24],"tags":[25,12,11,13,36,9],"_links":{"self":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/407"}],"collection":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=407"}],"version-history":[{"count":46,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":450,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions\/450"}],"wp:attachment":[{"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chazix-scripts.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}