Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity Copy to clipboard on Android

Can someone please help me with this? I saw some codes and they are really hard to understand also I am quite a beginner in Unity and C#. How to copy to clipboard text? Are there any assets maybe out there which could help?

like image 335
Qiasm Avatar asked Sep 19 '25 04:09

Qiasm


2 Answers

The simple way is:

GUIUtility.systemCopyBuffer = "the text you want to copy";

I don't know if this is supported on Android.

like image 180
oferei Avatar answered Sep 20 '25 20:09

oferei


You should use the UniClipboard asset.

Import it to your project and then just call:

UniClipboard.SetText("text you want to copy");

If you need to get the text from clipboard:

string text = UniClipboard.GetText();
like image 27
thiagolr Avatar answered Sep 20 '25 21:09

thiagolr