MCPcopy Create free account
hub / github.com/Tencent/xLua / DelegateConstructor

Function DelegateConstructor

Assets/XLua/Src/StaticLuaCallbacks.cs:1103–1121  ·  view source on GitHub ↗
(RealStatePtr L)

Source from the content-addressed store, hash-verified

1101 }
1102
1103 [MonoPInvokeCallback(typeof(LuaCSFunction))]
1104 public static int DelegateConstructor(RealStatePtr L)
1105 {
1106 try
1107 {
1108 ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
1109 Type type = getType(L, translator, 1);
1110 if (type == null || !typeof(Delegate).IsAssignableFrom(type))
1111 {
1112 return LuaAPI.luaL_error(L, "delegate constructor: #1 argument must be a Delegate's type");
1113 }
1114 translator.PushAny(L, translator.GetObject(L, 2, type));
1115 return 1;
1116 }
1117 catch (Exception e)
1118 {
1119 return LuaAPI.luaL_error(L, "c# exception in delegate constructor: " + e);
1120 }
1121 }
1122
1123 [MonoPInvokeCallback(typeof(LuaCSFunction))]
1124 public static int ToFunction(RealStatePtr L)

Callers

nothing calls this directly

Calls 5

FindMethod · 0.80
luaL_errorMethod · 0.80
PushAnyMethod · 0.80
GetObjectMethod · 0.80
getTypeFunction · 0.70

Tested by

no test coverage detected