Exemple #1
0
        static int _m_DestroyAll(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CoreCompositePool gen_to_be_invoked = (CoreCompositePool)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
                {
                    bool _onlyUnUsed = LuaAPI.lua_toboolean(L, 2);

                    gen_to_be_invoked.DestroyAll(_onlyUnUsed);



                    return(0);
                }
                if (gen_param_count == 1)
                {
                    gen_to_be_invoked.DestroyAll(  );



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

            return(LuaAPI.luaL_error(L, "invalid arguments to CoreCompositePool.DestroyAll!"));
        }
Exemple #2
0
 public LoadGameObjectFunc()
 {
     m_LoadCall = (AssetItem item) =>
     {
         GameObject         t            = null;
         CoreGameObjectPool resourcePool = null;
         m_Owner.m_Pools.TryGetValue(m_AssetPath, out resourcePool);
         if (resourcePool is null)
         {
             resourcePool = new CoreGameObjectPool(item);
             m_Owner.m_Pools.Add(m_AssetPath, resourcePool);
         }
         else
         {
             GameManager.Instance.m_ABMgr.UnloadAsset(item);
         }
         t = resourcePool.Spawn();
         m_Callback?.Invoke(t);
         m_Callback  = null;
         m_AssetPath = null;
         m_Parent    = null;
         m_Name      = null;
         m_Owner.m_LambdaCache.AddLast(this);
         m_Owner = null;
     };
 }
Exemple #3
0
 public void Init(CoreCompositePool owner, string assetPath, Action <GameObject> callback, GameObject parent = null, string name = null)
 {
     m_Owner     = owner;
     m_AssetPath = assetPath;
     m_Callback  = callback;
     m_Parent    = parent;
     m_Name      = name;
 }
Exemple #4
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    CoreCompositePool gen_ret = new CoreCompositePool();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to CoreCompositePool constructor!"));
        }
Exemple #5
0
        static int _m_ClearAll(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CoreCompositePool gen_to_be_invoked = (CoreCompositePool)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.ClearAll(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemple #6
0
        static int _m_Spawn(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CoreCompositePool gen_to_be_invoked = (CoreCompositePool)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Transform>(L, 3))
                {
                    string _path = LuaAPI.lua_tostring(L, 2);
                    UnityEngine.Transform _parent = (UnityEngine.Transform)translator.GetObject(L, 3, typeof(UnityEngine.Transform));

                    UnityEngine.GameObject gen_ret = gen_to_be_invoked.Spawn(_path, _parent);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _path = LuaAPI.lua_tostring(L, 2);

                    UnityEngine.GameObject gen_ret = gen_to_be_invoked.Spawn(_path);
                    translator.Push(L, gen_ret);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to CoreCompositePool.Spawn!"));
        }
Exemple #7
0
        static int _m_DestroyOne(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CoreCompositePool gen_to_be_invoked = (CoreCompositePool)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    string _path       = LuaAPI.lua_tostring(L, 2);
                    bool   _OnlyUnUsed = LuaAPI.lua_toboolean(L, 3);

                    gen_to_be_invoked.DestroyOne(_path, _OnlyUnUsed);



                    return(0);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _path = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.DestroyOne(_path);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to CoreCompositePool.DestroyOne!"));
        }
Exemple #8
0
        static int _m_Recycle(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CoreCompositePool gen_to_be_invoked = (CoreCompositePool)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.GameObject _obj = (UnityEngine.GameObject)translator.GetObject(L, 2, typeof(UnityEngine.GameObject));

                    gen_to_be_invoked.Recycle(_obj);



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