当前位置: 首页>>代码示例>>C#>>正文


C# LuaFunction.GetLuaState方法代码示例

本文整理汇总了C#中LuaInterface.LuaFunction.GetLuaState方法的典型用法代码示例。如果您正苦于以下问题:C# LuaFunction.GetLuaState方法的具体用法?C# LuaFunction.GetLuaState怎么用?C# LuaFunction.GetLuaState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LuaInterface.LuaFunction的用法示例。


在下文中一共展示了LuaFunction.GetLuaState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateDelegate

    public static Delegate CreateDelegate(Type t, LuaFunction func, LuaTable self)
    {
        DelegateValue Create = null;

        if (!dict.TryGetValue(t, out Create))
        {
            throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t)));
        }

        if (func != null)
        {
            LuaState state = func.GetLuaState();
            LuaDelegate target = state.GetLuaDelegate(func, self);

            if (target != null)
            {
                return Delegate.CreateDelegate(t, target, target.method);
            }
            else
            {
                Delegate d = Create(func, self, true);
                target = d.Target as LuaDelegate;
                state.AddLuaDelegate(target, func, self);
                return d;
            }
        }

        return Create(func, self, true);
    }
开发者ID:zhangxiangsong,项目名称:some_work,代码行数:29,代码来源:DelegateFactory.cs

示例2: AudioClip_PCMSetPositionCallback

 public static Delegate AudioClip_PCMSetPositionCallback(LuaFunction func)
 {
     AudioClip.PCMSetPositionCallback d = (param0) =>
     {
         int top = func.BeginPCall();
         IntPtr L = func.GetLuaState();
         LuaScriptMgr.Push(L, param0);
         func.PCall(top, 1);
         func.EndPCall(top);
     };
     return d;
 }
开发者ID:soulhez,项目名称:hugular_cstolua,代码行数:12,代码来源:DelegateFactory.cs

示例3: Action_GameObject

	public static Delegate Action_GameObject(LuaFunction func)
	{
		Action<GameObject> d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:Venbb,项目名称:mgame,代码行数:12,代码来源:DelegateFactory.cs

示例4: Application_LogCallback

 public static Delegate Application_LogCallback(LuaFunction func)
 {
     Application.LogCallback d = (param0, param1, param2) =>
     {
         int top = func.BeginPCall();
         IntPtr L = func.GetLuaState();
         LuaScriptMgr.Push(L, param0);
         LuaScriptMgr.Push(L, param1);
         LuaScriptMgr.Push(L, param2);
         func.PCall(top, 3);
         func.EndPCall(top);
     };
     return d;
 }
开发者ID:soulhez,项目名称:hugular_cstolua,代码行数:14,代码来源:DelegateFactory.cs

示例5: System_Reflection_MemberFilter

	public static Delegate System_Reflection_MemberFilter(LuaFunction func)
	{
		System.Reflection.MemberFilter d = (param0, param1) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.PushObject(L, param0);
			LuaScriptMgr.PushVarObject(L, param1);
			func.PCall(top, 2);
			object[] objs = func.PopValues(top);
			func.EndPCall(top);
			return (bool)objs[0];
		};
		return d;
	}
开发者ID:Gemini2015,项目名称:uLua,代码行数:15,代码来源:DelegateFactory.cs

示例6: TestLuaDelegate_VoidDelegate

	public static Delegate TestLuaDelegate_VoidDelegate(LuaFunction func)
	{
		TestLuaDelegate.VoidDelegate d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:neutra,项目名称:uLuaGameFramework,代码行数:12,代码来源:DelegateFactory.cs

示例7: UIEventListener_KeyCodeDelegate

	public static Delegate UIEventListener_KeyCodeDelegate(LuaFunction func)
	{
		UIEventListener.KeyCodeDelegate d = (param0, param1) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			LuaScriptMgr.Push(L, param1);
			func.PCall(top, 2);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:13,代码来源:DelegateFactory.cs

示例8: UIPanel_OnClippingMoved

	public static Delegate UIPanel_OnClippingMoved(LuaFunction func)
	{
		UIPanel.OnClippingMoved d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:12,代码来源:DelegateFactory.cs

示例9: UICenterOnChild_OnCenterCallback

	public static Delegate UICenterOnChild_OnCenterCallback(LuaFunction func)
	{
		UICenterOnChild.OnCenterCallback d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:12,代码来源:DelegateFactory.cs

示例10: Action_float_object

	public static Delegate Action_float_object(LuaFunction func)
	{
		Action<float,object> d = (param0, param1) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			LuaScriptMgr.PushVarObject(L, param1);
			func.PCall(top, 2);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:toophy,项目名称:hugular_cstolua,代码行数:13,代码来源:DelegateFactory.cs

示例11: Action_CTransport_CRequest

	public static Delegate Action_CTransport_CRequest(LuaFunction func)
	{
		Action<CTransport,CRequest> d = (param0, param1) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			LuaScriptMgr.PushObject(L, param1);
			func.PCall(top, 2);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:toophy,项目名称:hugular_cstolua,代码行数:13,代码来源:DelegateFactory.cs

示例12: UIWidget_OnPostFillCallback

	public static Delegate UIWidget_OnPostFillCallback(LuaFunction func)
	{
		UIWidget.OnPostFillCallback d = (param0, param1, param2, param3, param4) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			LuaScriptMgr.Push(L, param1);
			LuaScriptMgr.PushObject(L, param2);
			LuaScriptMgr.PushObject(L, param3);
			LuaScriptMgr.PushObject(L, param4);
			func.PCall(top, 5);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:16,代码来源:DelegateFactory.cs

示例13: Localization_LoadFunction

	public static Delegate Localization_LoadFunction(LuaFunction func)
	{
		Localization.LoadFunction d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			object[] objs = func.PopValues(top);
			func.EndPCall(top);
			return (byte[])objs[0];
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:14,代码来源:DelegateFactory.cs

示例14: UICamera_GetTouchCallback

	public static Delegate UICamera_GetTouchCallback(LuaFunction func)
	{
		UICamera.GetTouchCallback d = (param0) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			func.PCall(top, 1);
			object[] objs = func.PopValues(top);
			func.EndPCall(top);
			return (UICamera.Touch)objs[0];
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:14,代码来源:DelegateFactory.cs

示例15: UICamera_ObjectDelegate

	public static Delegate UICamera_ObjectDelegate(LuaFunction func)
	{
		UICamera.ObjectDelegate d = (param0, param1) =>
		{
			int top = func.BeginPCall();
			IntPtr L = func.GetLuaState();
			LuaScriptMgr.Push(L, param0);
			LuaScriptMgr.Push(L, param1);
			func.PCall(top, 2);
			func.EndPCall(top);
		};
		return d;
	}
开发者ID:zhlikezhz,项目名称:Game,代码行数:13,代码来源:DelegateFactory.cs


注:本文中的LuaInterface.LuaFunction.GetLuaState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。