LuaInterface.LuaStatic.GetMetaReference C# (CSharp) Method

GetMetaReference() public static method

public static GetMetaReference ( IntPtr L, Type t ) : int
L System.IntPtr
t System.Type
return int
        public static int GetMetaReference(IntPtr L, Type t)
        {
            LuaState state = LuaState.Get(L);
            return state.GetMetaReference(t);
        }

Usage Example

示例#1
0
        public static Func <IntPtr, int> GetLuaReference(Type type)
        {
            int metaref = -1;

            return((IntPtr L ) =>
            {
#if MULTI_STATE
                return LuaStatic.GetMetaReference(L, type);
#else
                if (metaref > 0)
                {
                    return metaref;
                }

                metaref = LuaStatic.GetMetaReference(L, type);

                if (metaref > 0)
                {
                    LuaState.Get(L).OnDestroy += () => { metaref = -1; };
                }

                return metaref;
#endif
            });
        }
All Usage Examples Of LuaInterface.LuaStatic::GetMetaReference