Beispiel #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);
        }
Beispiel #2
0
 private static int _CreateMyClass(UniLua.ILuaState L)
 {
     if (L.CheckNum(0))
     {
         L.PushValue <TestUniToLua.TestClasses.MyClass>(new TestUniToLua.TestClasses.MyClass());
         return(1);
     }
     else if (L.CheckNum(1) && L.CheckType <TestUniToLua.TestClasses.MyClass>(0))
     {
         var arg1 = L.CheckValue <TestUniToLua.TestClasses.MyClass>(1);
         L.PushValue <TestUniToLua.TestClasses.MyClass>(new TestUniToLua.TestClasses.MyClass(arg1));
         return(1);
     }
     L.L_Error("call function args is error");
     return(1);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #5
0
 private static int StaticFunction(UniLua.ILuaState L)
 {
     if (L.CheckNum(2) && L.CheckType <System.Int32, System.Int32>(1))
     {
         var arg1   = L.CheckValue <System.Int32>(1);
         var arg2   = L.CheckValue <System.Int32>(2);
         var result = TestUniToLua.TestClasses.MyClass.StaticFunction(arg1, arg2);
         L.PushValue <System.Int32>(result);
         return(1);
     }
     L.L_Error("call function args is error");
     return(1);
 }
Beispiel #6
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);
 }
Beispiel #7
0
 private static int get_staticProperty(UniLua.ILuaState L)
 {
     L.PushValue <System.Int32>(TestUniToLua.TestClasses.MyClass.staticProperty);
     return(1);
 }
Beispiel #8
0
 private static int get_field(UniLua.ILuaState L)
 {
     L.PushValue <System.Int32>(TestUniToLua.TestClasses.MyStaticLib.field);
     return(1);
 }