本文整理汇总了C#中LuaNativeFunction类的典型用法代码示例。如果您正苦于以下问题:C# LuaNativeFunction类的具体用法?C# LuaNativeFunction怎么用?C# LuaNativeFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LuaNativeFunction类属于命名空间,在下文中一共展示了LuaNativeFunction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LuaAtPanic
public static LuaNativeFunction LuaAtPanic(LuaState L, LuaNativeFunction panicf)
{
LuaNativeFunction old;
LuaLock(L);
old = G(L).panic;
G(L).panic = panicf;
LuaUnlock(L);
return old;
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:9,代码来源:lapi.cs
示例2: RegisterTableFunction
/// <summary>
/// Registers the given function to the current table on the stack top.
/// </summary>
/// <param name="state"></param>
/// <param name="name"></param>
/// <param name="func"></param>
public static void RegisterTableFunction(this NLua.Lua state, string name, LuaNativeFunction func)
{
// Do not continue if we are not a table..
var isTable = NLua.LuaLib.LuaType(state.GetState(), -1) == LuaTypes.Table;
if (!isTable)
return;
// Push the name, function, and set the table..
NLua.LuaLib.LuaPushString(state.GetState(), name);
NLua.LuaLib.LuaPushStdCallCFunction(state.GetState(), func);
NLua.LuaLib.LuaRawSet(state.GetState(), -3);
}
开发者ID:ProfessorXZ,项目名称:Addons,代码行数:18,代码来源:NLuaExtensions.cs
示例3: MetaFunctions
public MetaFunctions (ObjectTranslator translator)
{
this.translator = translator;
gcFunction = new LuaNativeFunction (MetaFunctions.CollectObject);
toStringFunction = new LuaNativeFunction (MetaFunctions.ToStringLua);
indexFunction = new LuaNativeFunction (MetaFunctions.GetMethod);
newindexFunction = new LuaNativeFunction (MetaFunctions.SetFieldOrProperty);
baseIndexFunction = new LuaNativeFunction (MetaFunctions.GetBaseMethod);
callConstructorFunction = new LuaNativeFunction (MetaFunctions.CallConstructor);
classIndexFunction = new LuaNativeFunction (MetaFunctions.GetClassMethod);
classNewindexFunction = new LuaNativeFunction (MetaFunctions.SetClassFieldOrProperty);
execDelegateFunction = new LuaNativeFunction (MetaFunctions.RunFunctionDelegate);
}
开发者ID:vontio,项目名称:NLua,代码行数:13,代码来源:Metatables.cs
示例4: LuaMethodWrapper
/*
* Constructs the wrapper for a known MethodBase instance
*/
public LuaMethodWrapper (ObjectTranslator translator, object target, ProxyType targetType, MethodBase method)
{
invokeFunction = new LuaNativeFunction (this.Call);
_Translator = translator;
_Target = target;
if (targetType != null)
_ExtractTarget = translator.typeChecker.GetExtractor (targetType);
_Method = method;
_MethodName = method.Name;
_IsStatic = method.IsStatic;
}
开发者ID:SD-J,项目名称:UnityLua,代码行数:16,代码来源:LuaMethodWrapper.cs
示例5: LuaMethodWrapper
/// <summary>
/// Constructs the wrapper for a known method name
/// </summary>
/// <param name="translator"></param>
/// <param name="targetType"></param>
/// <param name="methodName"></param>
/// <param name="bindingType"></param>
public LuaMethodWrapper(ObjectTranslator translator, IReflect targetType, string methodName, BindingFlags bindingType)
{
invokeFunction = new LuaNativeFunction(this.Call);
_Translator = translator;
_MethodName = methodName;
if (targetType != null)
_ExtractTarget = translator.typeChecker.GetExtractor(targetType);
_BindingType = bindingType;
//CP: Removed NonPublic binding search and added IgnoreCase
_Members = targetType.UnderlyingSystemType.GetMember(methodName, MemberTypes.Method, bindingType | BindingFlags.Public | BindingFlags.IgnoreCase/*|BindingFlags.NonPublic*/);
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:21,代码来源:LuaMethodWrapper.cs
示例6: LuaMethodWrapper
/*
* Constructs the wrapper for a known MethodBase instance
*/
public LuaMethodWrapper (ObjectTranslator translator, object target, IReflect targetType, MethodBase method)
{
invokeFunction = new LuaNativeFunction (this.Call);
_Translator = translator;
_Target = target;
if (targetType != null)
_ExtractTarget = translator.typeChecker.GetExtractor (targetType);
_Method = method;
_MethodName = method.Name;
if (method.IsStatic)
_BindingType = BindingFlags.Static;
else
_BindingType = BindingFlags.Instance;
}
开发者ID:ZoneBeat,项目名称:FAForeverMapEditor,代码行数:20,代码来源:LuaMethodWrapper.cs
示例7: ObjectTranslator
public ObjectTranslator(Lua interpreter, LuaState luaState)
{
this.interpreter = interpreter;
typeChecker = new CheckType(this);
metaFunctions = new MetaFunctions(this);
assemblies = new List<Assembly>();
importTypeFunction = new LuaNativeFunction(ObjectTranslator.ImportType);
loadAssemblyFunction = new LuaNativeFunction(ObjectTranslator.LoadAssembly);
registerTableFunction = new LuaNativeFunction(ObjectTranslator.RegisterTable);
unregisterTableFunction = new LuaNativeFunction(ObjectTranslator.UnregisterTable);
getMethodSigFunction = new LuaNativeFunction(ObjectTranslator.GetMethodSignature);
getConstructorSigFunction = new LuaNativeFunction(ObjectTranslator.GetConstructorSignature);
ctypeFunction = new LuaNativeFunction(ObjectTranslator.CType);
enumFromIntFunction = new LuaNativeFunction(ObjectTranslator.EnumFromInt);
CreateLuaObjectList(luaState);
CreateIndexingMetaFunction(luaState);
CreateBaseClassMetatable(luaState);
CreateClassMetatable(luaState);
CreateFunctionMetatable(luaState);
SetGlobalFunctions(luaState);
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:23,代码来源:ObjectTranslator.cs
示例8: NewFEnv
private static void NewFEnv(LuaState L, LuaNativeFunction cls)
{
LuaCreateTable(L, 0, 1);
LuaPushCFunction(L, cls);
LuaSetField(L, -2, "__close");
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:6,代码来源:liolib.cs
示例9: LuaPushCFunction
public static void LuaPushCFunction(LuaState L, LuaNativeFunction f)
{
LuaPushCClosure(L, f, 0);
}
开发者ID:NLua,项目名称:KopiLua,代码行数:4,代码来源:lua.cs
示例10: LuaRegister
public static void LuaRegister(LuaState L, CharPtr n, LuaNativeFunction f)
{
LuaPushCFunction(L, f);
LuaSetGlobal(L, n);
}
开发者ID:NLua,项目名称:KopiLua,代码行数:5,代码来源:lua.cs
示例11: LuaLReg
public LuaLReg(CharPtr name, LuaNativeFunction func) {
this.name = name;
this.func = func;
}
开发者ID:oathx,项目名称:Six,代码行数:4,代码来源:lauxlib.cs
示例12: MetaFunctions
public MetaFunctions (ObjectTranslator translator)
{
this.translator = translator;
GcFunction = new LuaNativeFunction (MetaFunctions.CollectObject);
ToStringFunction = new LuaNativeFunction (MetaFunctions.ToStringLua);
IndexFunction = new LuaNativeFunction (MetaFunctions.GetMethod);
NewIndexFunction = new LuaNativeFunction (MetaFunctions.SetFieldOrProperty);
BaseIndexFunction = new LuaNativeFunction (MetaFunctions.GetBaseMethod);
CallConstructorFunction = new LuaNativeFunction (MetaFunctions.CallConstructor);
ClassIndexFunction = new LuaNativeFunction (MetaFunctions.GetClassMethod);
ClassNewindexFunction = new LuaNativeFunction (MetaFunctions.SetClassFieldOrProperty);
ExecuteDelegateFunction = new LuaNativeFunction (MetaFunctions.RunFunctionDelegate);
AddFunction = new LuaNativeFunction (MetaFunctions.AddLua);
SubtractFunction = new LuaNativeFunction (MetaFunctions.SubtractLua);
MultiplyFunction = new LuaNativeFunction (MetaFunctions.MultiplyLua);
DivisionFunction = new LuaNativeFunction (MetaFunctions.DivideLua);
ModulosFunction = new LuaNativeFunction (MetaFunctions.ModLua);
UnaryNegationFunction = new LuaNativeFunction (MetaFunctions.UnaryNegationLua);
EqualFunction = new LuaNativeFunction (MetaFunctions.EqualLua);
LessThanFunction = new LuaNativeFunction (MetaFunctions.LessThanLua);
LessThanOrEqualFunction = new LuaNativeFunction (MetaFunctions.LessThanOrEqualLua);
}
开发者ID:hanbim520,项目名称:UFLua,代码行数:22,代码来源:Metatables.cs
示例13: Lua
public Lua ()
{
luaState = LuaLib.LuaLNewState (); // steffenj: Lua 5.1.1 API change (lua_open is gone)
LuaLib.LuaLOpenLibs (luaState); // steffenj: Lua 5.1.1 API change (luaopen_base is gone, just open all libs right here)
Init ();
// We need to keep this in a managed reference so the delegate doesn't get garbage collected
panicCallback = new LuaNativeFunction (PanicCallback);
LuaLib.LuaAtPanic (luaState, panicCallback);
}
开发者ID:nobitagamer,项目名称:NLua,代码行数:9,代码来源:Lua.cs
示例14: LuaAtPanic
public static void LuaAtPanic (IntPtr luaState, LuaNativeFunction panicf)
{
IntPtr fnpanic = Marshal.GetFunctionPointerForDelegate (panicf);
NativeMethods.LuaAtPanic (luaState, fnpanic);
}
开发者ID:wilcomega,项目名称:Unity3D-NLua,代码行数:5,代码来源:Lua.cs
示例15: Lua
public Lua ()
{
luaState = LuaLib.LuaLNewState ();
LuaLib.LuaLOpenLibs (luaState);
Init ();
// We need to keep this in a managed reference so the delegate doesn't get garbage collected
panicCallback = new LuaNativeFunction (PanicCallback);
LuaLib.LuaAtPanic (luaState, panicCallback);
}
开发者ID:JCH2k,项目名称:NLua,代码行数:9,代码来源:Lua.cs
示例16: LuaPushCClosure
public static void LuaPushCClosure(LuaState L, LuaNativeFunction fn, int n)
{
Closure cl;
LuaLock(L);
LuaCCheckGC(L);
CheckNElements(L, n);
cl = LuaFNewCclosure(L, n, GetCurrentEnv(L));
cl.c.f = fn;
L.top -= n;
while (n-- != 0)
SetObj2N(L, cl.c.upvalue[n], L.top + n);
SetCLValue(L, L.top, cl);
LuaAssert(IsWhite(obj2gco(cl)));
IncrementTop(L);
LuaUnlock(L);
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:16,代码来源:lapi.cs
示例17: LuaCPCall
public static int LuaCPCall(LuaState L, LuaNativeFunction func, object ud)
{
CCallS c = new CCallS();
int status;
LuaLock(L);
c.func = func;
c.ud = ud;
status = LuaDPCall(L, FunctionCCall, c, SaveStack(L, L.top), 0);
LuaUnlock(L);
return status;
}
开发者ID:arkanoid1,项目名称:FakePacketSender,代码行数:11,代码来源:lapi.cs
示例18: LuaAtPanic
public static void LuaAtPanic (LuaState luaState, LuaNativeFunction panicf)
{
LuaCore.LuaAtPanic (luaState, (LuaNativeFunction)panicf);
}
开发者ID:wuzhangwuzhang,项目名称:BWM,代码行数:4,代码来源:LuaLib.cs
示例19: LuaPushStdCallCFunction
public static void LuaPushStdCallCFunction(LuaState luaState, LuaNativeFunction function)
{
LuaPushCFunction (luaState, function);
}
开发者ID:niuniuzhu,项目名称:KopiLua,代码行数:4,代码来源:lnet.cs
示例20: PushCSFunction
internal void PushCSFunction (LuaNativeFunction function)
{
translator.PushFunction (luaState, function);
}
开发者ID:nobitagamer,项目名称:NLua,代码行数:4,代码来源:Lua.cs
注:本文中的LuaNativeFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论