{"id":46,"date":"2020-06-03T00:49:28","date_gmt":"2020-06-03T00:49:28","guid":{"rendered":"https:\/\/lucyestela.com\/dev\/?p=46"},"modified":"2021-03-02T03:02:04","modified_gmt":"2021-03-02T03:02:04","slug":"crossplatforminput","status":"publish","type":"post","link":"https:\/\/lucyestela.com\/dev\/unity\/crossplatforminput\/","title":{"rendered":"Cross Platform Input Manager &#8211; Unity"},"content":{"rendered":"<div class=\"boldgrid-section\">\n<div class=\"container\">\n<div class=\"row\">\n<div class=\"col-md-12 col-xs-12 col-sm-12\">\n<p>To use the cross platform input manager you need to make sure you have the Standard Assets Package included in your Unity project. To import it, use these instructions<\/p>\n<p class=\"\"><a href=\"https:\/\/docs.unity3d.com\/560\/Documentation\/Manual\/AssetPackages.html\">https:\/\/docs.unity3d.com\/560\/Documentation\/Manual\/AssetPackages.html<\/a><\/p>\n<p class=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-53 alignnone\" src=\"https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1-216x300.png\" alt=\"\" width=\"216\" height=\"300\" srcset=\"https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1-216x300.png 216w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1-250x348.png 250w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1-129x180.png 129w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1-359x500.png 359w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform1.png 365w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><br \/>\nEnsure that CrossPlatformInput is selected in both the \u201cEditor\u201d and \u201cStandard Assets\u201d folders.<\/p>\n<p class=\"\">Open up the Project Setting &gt; Inputs to define all of the controls<\/p>\n<p class=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-58 size-medium alignnone\" src=\"https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-300x183.gif\" alt=\"\" width=\"300\" height=\"183\" srcset=\"https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-300x183.gif 300w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-250x152.gif 250w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-550x335.gif 550w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-295x180.gif 295w, https:\/\/lucyestela.com\/dev\/wp-content\/uploads\/2020\/06\/crossPlatform2-1-492x300.gif 492w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p class=\"\">To refer to the CPI from your class file you must include it at the top with<\/p>\n<pre><span style=\"font-family: Menlo;\"> <span style=\"color: #009695;\">using<\/span><span style=\"color: #222222;\">&nbsp;<\/span><span style=\"color: #222222;\">UnityStandardAssets<\/span><span style=\"color: #222222;\">.<\/span><span style=\"color: #222222;\">CrossPlatformInput<\/span><span style=\"color: #222222;\">;<\/span><\/span><\/pre>\n<p class=\"\">Then you can reference it directly<\/p>\n<pre><span style=\"font-family: Menlo;\"> <span style=\"color: #3363a4;\">CrossPlatformInputManager<\/span><span style=\"color: #222222;\">.<\/span><span style=\"color: #222222;\">GetAxis<\/span><span style=\"color: #222222;\">(<\/span><span style=\"color: #db7100;\">\"Horizontal\"<\/span><span style=\"color: #222222;\">);<\/span><\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>To use the cross platform input manager you need to make sure you have the Standard Assets Package included in your Unity project. To import it, use these instructions https:\/\/docs.unity3d.com\/560\/Documentation\/Manual\/AssetPackages.html Ensure that CrossPlatformInput is selected in both the \u201cEditor\u201d and \u201cStandard Assets\u201d folders. Open up the Project Setting &gt; Inputs to define all of the &#8230; <a title=\"Cross Platform Input Manager &#8211; Unity\" class=\"read-more\" href=\"https:\/\/lucyestela.com\/dev\/unity\/crossplatforminput\/\" aria-label=\"More on Cross Platform Input Manager &#8211; Unity\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[58],"tags":[7,8,9,4],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-unity","tag-c","tag-cross-platform","tag-input-manager","tag-unity"],"_links":{"self":[{"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":9,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":249,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/posts\/46\/revisions\/249"}],"wp:attachment":[{"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lucyestela.com\/dev\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}