Skip to content

Commit ae88942

Browse files
committed
[修复]1. 修复没有平台支持的时候的构建报错
1 parent 3d55931 commit ae88942

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Runtime/BlankOperationClipboard.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// * 创建时间:2016年07月14日
3131
// * 创建人:Blank Alian
3232
// */
33+
3334
using UnityEngine;
3435

3536

@@ -42,7 +43,6 @@
4243
/// </summary>
4344
public 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+
}

0 commit comments

Comments
 (0)