gdl_123 5 месяцев назад
Родитель
Сommit
4cdc18b32e
2 измененных файлов с 23 добавлено и 1 удалено
  1. 5 0
      Assets/Src/GameLogic/GameMgr.cs
  2. 18 1
      Assets/ToLua/Source/Generate/GameMgrWrap.cs

+ 5 - 0
Assets/Src/GameLogic/GameMgr.cs

@@ -868,6 +868,11 @@ public class GameMgr : SingletonMono<GameMgr>
         //Application.OpenURL(url);
     }
 
+    public void CopyBuff(string buff)
+    {
+        if (string.IsNullOrEmpty(buff)) return;
+        GUIUtility.systemCopyBuffer = buff;
+    }
     public void EnableAntiAliasing()
     {
         if (DeviceInfo.m_DeviceState == DeviceInfo.eDeviceState.NORMAL_DEVICE)

+ 18 - 1
Assets/ToLua/Source/Generate/GameMgrWrap.cs

@@ -46,6 +46,7 @@ public class GameMgrWrap
 		L.RegFunction("RequestHttpServer", RequestHttpServer);
 		L.RegFunction("CleanUnusedAssets", CleanUnusedAssets);
 		L.RegFunction("OpenUrl", OpenUrl);
+		L.RegFunction("CopyBuff", CopyBuff);
 		L.RegFunction("EnableAntiAliasing", EnableAntiAliasing);
 		L.RegFunction("DisableAntiAliasing", DisableAntiAliasing);
 		L.RegFunction("SdkInitFunc", SdkInitFunc);
@@ -830,8 +831,24 @@ public class GameMgrWrap
 			return LuaDLL.toluaL_exception(L, e);
 		}
 	}
+    [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+    static int CopyBuff(IntPtr L)
+    {
+        try
+        {
+            ToLua.CheckArgsCount(L, 2);
+            GameMgr obj = (GameMgr)ToLua.CheckObject<GameMgr>(L, 1);
+            string arg0 = ToLua.CheckString(L, 2);
+            obj.CopyBuff(arg0);
+            return 0;
+        }
+        catch (Exception e)
+        {
+            return LuaDLL.toluaL_exception(L, e);
+        }
+    }
 
-	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+    [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
 	static int EnableAntiAliasing(IntPtr L)
 	{
 		try