{"id":54232,"date":"2017-04-06T18:10:47","date_gmt":"2017-04-06T16:10:47","guid":{"rendered":"http:\/\/elwinlee.com\/blog\/?p=54232"},"modified":"2017-04-06T18:46:10","modified_gmt":"2017-04-06T16:46:10","slug":"unity3d-copy-to-clipboard-script-for-ios-android","status":"publish","type":"post","link":"https:\/\/www.elwinlee.com\/blog\/unity3d-copy-to-clipboard-script-for-ios-android\/","title":{"rendered":"[Unity3D] Copy to Clipboard Script for iOS &#038; Android"},"content":{"rendered":"<p>I was looking for a way to copy a piece of text to the clipboard on iOS and Android devices the other day. There are ways to do it for Windows and Mac computers, but getting that to work for mobile devices seemed a bit trickier. There were some solutions on the Unity3D Community forums, but they were always either for iOS\u00a0<strong>OR<\/strong> Android and required additional extra steps to make it actually work. Luckily, I found this handy script by\u00a0Wataru Sanuki which handles cross platform copy to clipboard in a single class.<!--more--><\/p>\n<p>To copy text to clipboard, simply use:<\/p>\n<blockquote><p>UniClipboard.SetText (&#8220;text you want to clip&#8221;);<\/p><\/blockquote>\n<p>And to get to text from clipboard, just use:<\/p>\n<blockquote><p>UniClipboard.GetText ();<\/p><\/blockquote>\n<p>That&#8217;s it! You can download the script here:\u00a0<a href=\"https:\/\/github.com\/sanukin39\/UniClipboard\">https:\/\/github.com\/sanukin39\/UniClipboard<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Handy Unity3D script to copy to clipboard for mobile devices<\/p>\n","protected":false},"author":1,"featured_media":54235,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1079,255],"tags":[47,476,785,2009,2010,2082,2211,2222,2248,2338,2502,2503,2504],"class_list":["post-54232","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to-fix-stuff","category-technology","tag-apple","tag-google","tag-plugin","tag-unity3d","tag-unity","tag-android","tag-copy","tag-script","tag-mobile","tag-ios","tag-clipboard","tag-uniclipboard","tag-devices"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.elwinlee.com\/blog\/wp-content\/uploads\/2017\/04\/unity-copy-to-clipboard.png","jetpack_shortlink":"https:\/\/wp.me\/p1mtRf-e6I","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/comments?post=54232"}],"version-history":[{"count":2,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54232\/revisions"}],"predecessor-version":[{"id":54242,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/posts\/54232\/revisions\/54242"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/media\/54235"}],"wp:attachment":[{"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/media?parent=54232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/categories?post=54232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elwinlee.com\/blog\/wp-json\/wp\/v2\/tags?post=54232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}