FairyGUI.GList.GetFromPool C# (CSharp) Method

GetFromPool() public method

public GetFromPool ( string url ) : GObject
url string
return GObject
        public GObject GetFromPool(string url)
        {
            if (string.IsNullOrEmpty(url))
                url = defaultItem;

            GObject ret = _pool.GetObject(url);
            if (ret != null)
                ret.visible = true;
            return ret;
        }

Usage Example

示例#1
0
        GButton CreateItem(string caption, Delegate callback)
        {
            GButton item = _list.GetFromPool(_list.defaultItem).asButton;

            item.title  = caption;
            item.grayed = false;
            Controller c = item.GetController("checked");

            if (c != null)
            {
                c.selectedIndex = 0;
            }
            item.RemoveEventListeners(EVENT_TYPE);
            if (callback is EventCallback0)
            {
                item.AddEventListener(EVENT_TYPE, (EventCallback0)callback);
            }
            else
            {
                item.AddEventListener(EVENT_TYPE, (EventCallback1)callback);
            }

            item.onRollOver.Add(__rollOver);
            item.onRollOut.Add(__rollOut);

            return(item);
        }
All Usage Examples Of FairyGUI.GList::GetFromPool