using UnityEngine; using System.Runtime.InteropServices; public class CopyAndPaste { #if UNITY_WEBGL [DllImport("__Internal")] private static extern void CopyToClipboardAndShare(string text); [DllImport("__Internal")] private static extern string GetCurrentUrl(); #endif public static void Copy(string text) { #if UNITY_EDITOR GUIUtility.systemCopyBuffer = text; #endif #if !UNITY_EDITOR && UNITY_WEBGL CopyToClipboardAndShare(text); #endif }//Copy() end }//class end