FairyGUI.GList.AddItemFromPool C# (CSharp) Method

AddItemFromPool() public method

Add a item to list, same as GetFromPool+AddChild
public AddItemFromPool ( ) : GObject
return GObject
        public GObject AddItemFromPool()
        {
            GObject obj = GetFromPool(null);

            return AddChild(obj);
        }

Same methods

GList::AddItemFromPool ( string url ) : GObject

Usage Example

示例#1
0
    void Start()
    {
        Application.targetFrameRate = 60;
        Stage.inst.onKeyDown.Add(OnKeyDown);

        _mainView = this.GetComponent<UIPanel>().ui;

        _list = _mainView.GetChild("mailList").asList;
        for (int i = 0; i < 10; i++)
        {
            MailItem item = (MailItem)_list.AddItemFromPool();
            item.setFetched(i % 3 == 0);
            item.setRead(i % 2 == 0);
            item.setTime("5 Nov 2015 16:24:33");
            item.title = "Mail title here";
        }

        _list.EnsureBoundsCorrect();
        float delay = 0f;
        for (int i = 0; i < 10; i++)
        {
            MailItem item = (MailItem)_list.GetChildAt(i);
            if (_list.IsChildInView(item))
            {
                item.PlayEffect(delay);
                delay += 0.2f;
            }
            else
                break;
        }
    }
All Usage Examples Of FairyGUI.GList::AddItemFromPool