Skip to content

Instantly share code, notes, and snippets.

@oismaelash
Created March 18, 2019 13:29
Show Gist options
  • Save oismaelash/a295462859ec21ef03d707b6a4494f4b to your computer and use it in GitHub Desktop.
Save oismaelash/a295462859ec21ef03d707b6a4494f4b to your computer and use it in GitHub Desktop.
using UnityEngine;
public class CopyToClipboardUnity : MonoBehaviour
{
[SerializeField] private string myText;
public void OnButtonCopyClipboardClicked()
{
TextEditor textForCopy = new TextEditor
{
text = myText
};
textForCopy.SelectAll();
textForCopy.Copy();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment