Example #1
0
        /// <summary>
        /// [PixelCrushers] Registers a C# method by its MethodInfo.
        /// </summary>
        /// <returns>The Lua function instance wrapping the method.</returns>
        /// <param name="name">Name of the function in Lua.</param>
        /// <param name="target">Target object containing the method (or <c>null</c>).</param>
        /// <param name="methodInfo">Method info.</param>
        public LuaFunction RegisterMethodFunction(string name, object target, System.Reflection.MethodInfo methodInfo)
        {
            LuaMethodFunction luaFunc = new LuaMethodFunction(target, methodInfo);

            this.SetNameValue(name, luaFunc);
            return(luaFunc);
        }
Example #2
0
 /// <summary>
 /// [PixelCrushers] Registers a C# method by its MethodInfo.
 /// </summary>
 /// <returns>The Lua function instance wrapping the method.</returns>
 /// <param name="name">Name of the function in Lua.</param>
 /// <param name="target">Target object containing the method (or <c>null</c>).</param>
 /// <param name="methodInfo">Method info.</param>
 public LuaFunction RegisterMethodFunction(string name, object target, System.Reflection.MethodInfo methodInfo)
 {
     LuaMethodFunction luaFunc = new LuaMethodFunction(target, methodInfo);
     this.SetNameValue(name, luaFunc);
     return luaFunc;
 }