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

Function getType

Assets/XLua/Src/StaticLuaCallbacks.cs:946–967  ·  view source on GitHub ↗
(RealStatePtr L, ObjectTranslator translator, int idx)

Source from the content-addressed store, hash-verified

944 }
945
946 static Type getType(RealStatePtr L, ObjectTranslator translator, int idx)
947 {
948 if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TTABLE)
949 {
950 LuaTable tbl;
951 translator.Get(L, idx, out tbl);
952 return tbl.Get<Type>("UnderlyingSystemType");
953 }
954 else if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TSTRING)
955 {
956 string className = LuaAPI.lua_tostring(L, idx);
957 return translator.FindType(className);
958 }
959 else if (translator.GetObject(L, idx) is Type)
960 {
961 return translator.GetObject(L, idx) as Type;
962 }
963 else
964 {
965 return null;
966 }
967 }
968
969 [MonoPInvokeCallback(typeof(LuaCSFunction))]
970 public static int XLuaAccess(RealStatePtr L)

Callers 7

ImportGenericTypeFunction · 0.70
XLuaAccessFunction · 0.70
XLuaPrivateAccessibleFunction · 0.70
XLuaMetatableOperationFunction · 0.70
DelegateConstructorFunction · 0.70
GenericMethodWraperFunction · 0.70
GetGenericMethodFunction · 0.70

Calls 5

lua_typeMethod · 0.80
lua_tostringMethod · 0.80
FindTypeMethod · 0.80
GetObjectMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected