Example #1
0
	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;
	}
Example #2
0
	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;
	}
Example #3
0
        //    void Update()
        //    {
        //#if UNITY_EDITOR
        //        if (luaState == null)
        //        {
        //            return;
        //        }
        //#endif
        //        if (luaState.LuaUpdate(Time.deltaTime, Time.unscaledDeltaTime) != 0)
        //        {
        //            ThrowException();
        //        }

        //        luaState.LuaPop(1);
        //        luaState.Collect();
        //#if UNITY_EDITOR
        //        luaState.CheckTop();
        //#endif
        //    }
        internal void Update(float deltaTime, float unscaled)
        {
            //if (luaState.LuaUpdate(deltaTime, unscaled) != 0)
            //{
            //    ThrowException();
            //}

            UpdateFunc.BeginPCall();
            UpdateFunc.Push(deltaTime);
            UpdateFunc.Push(unscaled);
            UpdateFunc.PCall();
            UpdateFunc.EndPCall();
            luaState.LuaPop(1);
            luaState.Collect();
        }
Example #4
0
        internal void LateUpdate()
        {
            //#if UNITY_EDITOR
            if (luaState == null)
            {
                return;
            }
            //#endif
            //if (luaState.LuaLateUpdate() != 0)
            //{
            //    ThrowException();
            //}

            LateUpdateFunc.BeginPCall();
            LateUpdateFunc.PCall();
            LateUpdateFunc.EndPCall();

            luaState.LuaPop(1);
        }
Example #5
0
	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;
	}
Example #6
0
	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;
	}
Example #7
0
	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;
	}