KEngine MonoBehaivour Without Update, With some cache
상속: MonoBehaviour
        static int _m_Delete(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            KBehaviour __cl_gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1)
                {
                    __cl_gen_to_be_invoked.Delete(  );



                    return(0);
                }
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    float time = (float)LuaAPI.lua_tonumber(L, 2);

                    __cl_gen_to_be_invoked.Delete(time);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to KBehaviour.Delete!"));
        }
예제 #2
0
        static int _e_DestroyEvent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator             = ObjectTranslatorPool.Instance.Find(L);
                int        gen_param_count              = LuaAPI.lua_gettop(L);
                KBehaviour gen_to_be_invoked            = (KBehaviour)translator.FastGetCSObj(L, 1);
                System.Action <KBehaviour> gen_delegate = translator.GetDelegate <System.Action <KBehaviour> >(L, 3);
                if (gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#3 need System.Action<KBehaviour>!"));
                }

                if (gen_param_count == 3)
                {
                    if (LuaAPI.xlua_is_eq_str(L, 2, "+"))
                    {
                        gen_to_be_invoked.DestroyEvent += gen_delegate;
                        return(0);
                    }


                    if (LuaAPI.xlua_is_eq_str(L, 2, "-"))
                    {
                        gen_to_be_invoked.DestroyEvent -= gen_delegate;
                        return(0);
                    }
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            LuaAPI.luaL_error(L, "invalid arguments to KBehaviour.DestroyEvent!");
            return(0);
        }
        static int _s_set_TimeScale(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                KBehaviour __cl_gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.TimeScale = (float)LuaAPI.lua_tonumber(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int _g_get_CachedGameObject(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                KBehaviour __cl_gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);
                translator.Push(L, __cl_gen_to_be_invoked.CachedGameObject);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
예제 #5
0
        static int _g_get_TimeScale(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                KBehaviour gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.TimeScale);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
        static int _e_DestroyEvent(RealStatePtr L)
        {
            ObjectTranslator translator       = ObjectTranslatorPool.Instance.Find(L);
            int        __gen_param_count      = LuaAPI.lua_gettop(L);
            KBehaviour __cl_gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);

            try {
                System.Action <KBehaviour> __gen_delegate = translator.GetDelegate <System.Action <KBehaviour> >(L, 3);
                if (__gen_delegate == null)
                {
                    return(LuaAPI.luaL_error(L, "#3 need System.Action<KBehaviour>!"));
                }

                if (__gen_param_count == 3)
                {
                    System.IntPtr strlen;

                    System.IntPtr str = LuaAPI.lua_tolstring(L, 2, out strlen);

                    if (str != System.IntPtr.Zero && strlen.ToInt32() == 1)
                    {
                        byte op = System.Runtime.InteropServices.Marshal.ReadByte(str);


                        if (op == (byte)'+')
                        {
                            __cl_gen_to_be_invoked.DestroyEvent += __gen_delegate;
                            return(0);
                        }


                        if (op == (byte)'-')
                        {
                            __cl_gen_to_be_invoked.DestroyEvent -= __gen_delegate;
                            return(0);
                        }
                    }
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            LuaAPI.luaL_error(L, "invalid arguments to KBehaviour.DestroyEvent!");
            return(0);
        }
        static int _m_DeleteSelf(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            KBehaviour __cl_gen_to_be_invoked = (KBehaviour)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.DeleteSelf(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }