Beispiel #1
0
        public LuaValue InvokeMethod(LuaValue[] args)
        {
            if (Method == null || args == null)
            {
                return(LuaNil.Nil);
            }
            object[] objectArgs = new object[args.Length];
            for (int i = 0; i < args.Length; i++)
            {
                objectArgs[i] = LuaInterpreterExtensions.LuaValueToObject(args[i]);
            }
            object result = Method.Invoke(Target, objectArgs);

            return(LuaInterpreterExtensions.ObjectToLuaValue(result));
        }
Beispiel #2
0
 public LuaValue InvokeMethod(LuaValue[] args)
 {
     if (Method == null || args == null)
     {
         return(LuaNil.Nil);
     }
     object[] objectArgs = new object[args.Length];
     for (int i = 0; i < args.Length; i++)
     {
         objectArgs[i] = LuaInterpreterExtensions.LuaValueToObject(args[i]);
     }
     try
     {
         object result = Method.Invoke(Target, objectArgs);
         return(LuaInterpreterExtensions.ObjectToLuaValue(result));
     }
     catch (Exception e)
     {
         UnityEngine.Debug.LogException(e);
         throw e;
     }
 }