GObjectPool is use for GObject pooling.
示例#1
0
        private void SetErrorState()
        {
            if (!showErrorSign)
            {
                return;
            }

            if (_errorSign == null)
            {
                if (UIConfig.loaderErrorSign != null)
                {
                    if (errorSignPool == null)
                    {
                        errorSignPool = new GObjectPool();
                    }

                    _errorSign = errorSignPool.GetObject(UIConfig.loaderErrorSign);
                }
                else
                {
                    return;
                }
            }

            if (_errorSign != null)
            {
                _errorSign.SetSize(this.width, this.height);
                ((Container)displayObject).AddChild(_errorSign.displayObject);
            }
        }
示例#2
0
    static int set_initCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)o;
            FairyGUI.GObjectPool.InitCallbackDelegate arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (FairyGUI.GObjectPool.InitCallbackDelegate)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObjectPool.InitCallbackDelegate));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(FairyGUI.GObjectPool.InitCallbackDelegate), func) as FairyGUI.GObjectPool.InitCallbackDelegate;
            }

            obj.initCallback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index initCallback on a nil value" : e.Message));
        }
    }
 static public int set_initCallback(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool self = (FairyGUI.GObjectPool)checkSelf(l);
         FairyGUI.GObjectPool.InitCallbackDelegate v;
         int op = LuaDelegation.checkDelegate(l, 2, out v);
         if (op == 0)
         {
             self.initCallback = v;
         }
         else if (op == 1)
         {
             self.initCallback += v;
         }
         else if (op == 2)
         {
             self.initCallback -= v;
         }
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#4
0
        private void SetErrorState()
        {
            if (!showErrorSign || !Application.isPlaying)
            {
                return;
            }

            if (_errorSign == null)
            {
                if (UIConfig.loaderErrorSign != null)
                {
                    if (errorSignPool == null)
                    {
                        errorSignPool = new GObjectPool(Stage.inst.CreatePoolManager("LoaderErrorSignPool"));
                    }

                    _errorSign = errorSignPool.GetObject(UIConfig.loaderErrorSign);
                }
                else
                {
                    return;
                }
            }

            if (_errorSign != null)
            {
                _errorSign.SetSize(this.width, this.height);
                ((Container)displayObject).AddChild(_errorSign.displayObject);
            }
        }
示例#5
0
 public static void ClearStaticGLoader()
 {
     if (errorSignPool != null)
     {
         errorSignPool.Clear();
     }
     errorSignPool = null;
 }
示例#6
0
        public GList()
            : base()
        {
            _pool = new GObjectPool();
            _trackBounds = true;
            autoResizeItem = true;

            onClickItem = new EventListener(this, "onClickItem");
        }
示例#7
0
        public GList()
            : base()
        {
            _pool          = new GObjectPool();
            _trackBounds   = true;
            autoResizeItem = true;

            onClickItem = new EventListener(this, "onClickItem");
        }
 static public int Clear(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool self = (FairyGUI.GObjectPool)checkSelf(l);
         self.Clear();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_count(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool self = (FairyGUI.GObjectPool)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.count);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool o;
         o = new FairyGUI.GObjectPool();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#11
0
 static int Clear(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)ToLua.CheckObject(L, 1, typeof(FairyGUI.GObjectPool));
         obj.Clear();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int ReturnObject(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool self = (FairyGUI.GObjectPool)checkSelf(l);
         FairyGUI.GObject     a1;
         checkType(l, 2, out a1);
         self.ReturnObject(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#13
0
 static int ReturnObject(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.GObjectPool obj  = (FairyGUI.GObjectPool)ToLua.CheckObject(L, 1, typeof(FairyGUI.GObjectPool));
         FairyGUI.GObject     arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject));
         obj.ReturnObject(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int GetObject(IntPtr l)
 {
     try {
         FairyGUI.GObjectPool self = (FairyGUI.GObjectPool)checkSelf(l);
         System.String        a1;
         checkType(l, 2, out a1);
         var ret = self.GetObject(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#15
0
 static int GetObject(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)ToLua.CheckObject(L, 1, typeof(FairyGUI.GObjectPool));
         string           arg0    = ToLua.CheckString(L, 2);
         FairyGUI.GObject o       = obj.GetObject(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_initCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)o;
            FairyGUI.GObjectPool.InitCallbackDelegate arg0 = (FairyGUI.GObjectPool.InitCallbackDelegate)ToLua.CheckDelegate <FairyGUI.GObjectPool.InitCallbackDelegate>(L, 2);
            obj.initCallback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index initCallback on a nil value"));
        }
    }
示例#17
0
    static int get_count(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)o;
            int ret = obj.count;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index count on a nil value" : e.Message));
        }
    }
示例#18
0
    static int get_initCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GObjectPool obj = (FairyGUI.GObjectPool)o;
            FairyGUI.GObjectPool.InitCallbackDelegate ret = obj.initCallback;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index initCallback on a nil value" : e.Message));
        }
    }
示例#19
0
    static int get_pool(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyUI obj = (FairyUI)o;
            FairyGUI.GObjectPool ret = obj.pool;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pool on a nil value"));
        }
    }
    static int get_itemPool(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.GList       obj = (FairyGUI.GList)o;
            FairyGUI.GObjectPool ret = obj.itemPool;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index itemPool on a nil value" : e.Message));
        }
    }
示例#21
0
    static int _CreateFairyGUI_GObjectPool(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                FairyGUI.GObjectPool obj = new FairyGUI.GObjectPool();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.GObjectPool.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#22
0
    static int _CreateFairyGUI_GObjectPool(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.Transform));
                FairyGUI.GObjectPool  obj  = new FairyGUI.GObjectPool(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.GObjectPool.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#23
0
        int _virtualListChanged; //1-content changed, 2-size changed

        #endregion Fields

        #region Constructors

        public GList()
            : base()
        {
            _pool = new GObjectPool();
            _trackBounds = true;
            autoResizeItem = true;
            this.opaque = true;
            scrollItemToViewOnClick = true;

            onClickItem = new EventListener(this, "onClickItem");
        }
示例#24
0
        int _virtualListChanged; //1-content changed, 2-size changed

        #endregion Fields

        #region Constructors

        public GList()
            : base()
        {
            _trackBounds = true;
            autoResizeItem = true;
            this.opaque = true;
            scrollItemToViewOnClick = true;

            container = new Container();
            rootContainer.AddChild(container);
            rootContainer.gameObject.name = "GList";

            _pool = new GObjectPool(container.cachedTransform);

            onClickItem = new EventListener(this, "onClickItem");
        }
示例#25
0
        private void SetErrorState()
        {
            if (!showErrorSign || !Application.isPlaying)
                return;

            if (_errorSign == null)
            {
                if (UIConfig.loaderErrorSign != null)
                {
                    if (errorSignPool == null)
                        errorSignPool = new GObjectPool(Stage.inst.CreatePoolManager("LoaderErrorSignPool"));

                    _errorSign = errorSignPool.GetObject(UIConfig.loaderErrorSign);
                }
                else
                    return;
            }

            if (_errorSign != null)
            {
                _errorSign.width = this.width;
                _errorSign.height = this.height;
                _errorSign.grayed = grayed;
                ((Container)displayObject).AddChild(_errorSign.displayObject);
            }
        }