File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030// * 创建时间:2016年07月14日
3131// * 创建人:Blank Alian
3232// */
33+
3334using UnityEngine ;
3435
3536
4243/// </summary>
4344public sealed class BlankOperationClipboard
4445{
45-
4646#if UNITY_IOS
4747 [ DllImport ( "__Internal" ) ]
4848 private static extern string GetClipBoard ( ) ;
@@ -59,18 +59,18 @@ public sealed class BlankOperationClipboard
5959 /// <returns></returns>
6060 public static string GetValue ( )
6161 {
62- #if UNITY_EDITOR || UNITY_STANDALONE
63- return string . Empty ;
64- #elif UNITY_ANDROID
62+ #if UNITY_ANDROID
6563 using ( AndroidJavaClass androidJavaClass = new AndroidJavaClass ( "com.alianhome.operationclipboard.MainActivity" ) )
6664 {
6765 return androidJavaClass . CallStatic < string > ( "GetClipBoard" ) ;
6866 }
6967#elif UNITY_IOS
7068 return GetClipBoard ( ) ;
69+ #else
70+ return UnityEngine . GUIUtility . systemCopyBuffer ?? string . Empty ;
7171#endif
72-
7372 }
73+
7474 /// <summary>
7575 /// 设置粘贴板的值
7676 /// </summary>
@@ -89,6 +89,8 @@ public static void SetValue(string text)
8989 }
9090#elif UNITY_IOS
9191 SetClipBoard ( text ) ;
92+ #else
93+ UnityEngine . GUIUtility . systemCopyBuffer = text ;
9294#endif
9395 }
94- }
96+ }
You can’t perform that action at this time.
0 commit comments