Example #1
0
        private static int get_memberProperty(UniLua.ILuaState L)
        {
            var obj = (TestUniToLua.TestClasses.MyClass)L.ToObject(1);

            L.PushValue <System.Int32>(obj.memberProperty);
            return(1);
        }
Example #2
0
        private static int set_memberField(UniLua.ILuaState L)
        {
            var obj   = (TestUniToLua.TestClasses.MyClass)L.ToObject(1);
            var value = L.CheckValue <System.Int32>(2);

            obj.memberField = value;
            return(0);
        }
Example #3
0
 private static int GetType(UniLua.ILuaState L)
 {
     if (L.CheckNum(1))
     {
         var obj    = (TestUniToLua.TestClasses.MyClass)L.ToObject(1);
         var result = obj.GetType();
         L.PushValue <System.Type>(result);
         return(1);
     }
     L.L_Error("call function args is error");
     return(1);
 }
Example #4
0
 private static int Equals(UniLua.ILuaState L)
 {
     if (L.CheckNum(2) && L.CheckType <TestUniToLua.TestClasses.MyClass, System.Object>(1))
     {
         var obj    = (TestUniToLua.TestClasses.MyClass)L.ToObject(1);
         var arg1   = L.CheckValue <System.Object>(2);
         var result = obj.Equals(arg1);
         L.PushValue <System.Boolean>(result);
         return(1);
     }
     L.L_Error("call function args is error");
     return(1);
 }
Example #5
0
 private static int MemberFunction(UniLua.ILuaState L)
 {
     if (L.CheckNum(3) && L.CheckType <TestUniToLua.TestClasses.MyClass, System.Int32, System.Int32>(1))
     {
         var obj    = (TestUniToLua.TestClasses.MyClass)L.ToObject(1);
         var arg1   = L.CheckValue <System.Int32>(2);
         var arg2   = L.CheckValue <System.Int32>(3);
         var result = obj.MemberFunction(arg1, arg2);
         L.PushValue <System.Int32>(result);
         return(1);
     }
     L.L_Error("call function args is error");
     return(1);
 }