FairyGUI.GList.SetVirtual C# (CSharp) Method

SetVirtual() public method

public SetVirtual ( bool loop ) : void
loop bool
return void
        void SetVirtual(bool loop)
        {
            if (!_virtual)
            {
                if (this.scrollPane == null)
                    Debug.LogError("FairyGUI: Virtual list must be scrollable!");

                if (loop)
                {
                    if (_layout == ListLayoutType.FlowHorizontal || _layout == ListLayoutType.FlowVertical)
                        Debug.LogError("FairyGUI: Loop list is not supported for FlowHorizontal or FlowVertical layout!");

                    this.scrollPane.bouncebackEffect = false;
                }

                _virtual = true;
                _loop = loop;
                _virtualItems = new List<ItemInfo>();
                RemoveChildrenToPool();

                if (_itemSize.x == 0 || _itemSize.y == 0)
                {
                    GObject obj = GetFromPool(null);
                    if (obj == null)
                    {
                        Debug.LogError("FairyGUI: Virtual List must have a default list item resource.");
                        _itemSize = new Vector2(100, 100);
                    }
                    else
                    {
                        _itemSize = obj.size;
                        _itemSize.x = Mathf.CeilToInt(_itemSize.x);
                        _itemSize.y = Mathf.CeilToInt(_itemSize.y);
                        ReturnToPool(obj);
                    }
                }

                if (_layout == ListLayoutType.SingleColumn || _layout == ListLayoutType.FlowHorizontal)
                    this.scrollPane.scrollSpeed = _itemSize.y;
                else
                    this.scrollPane.scrollSpeed = _itemSize.x;

                this.scrollPane.onScroll.AddCapture(__scrolled);
                SetVirtualListChangedFlag(true);
            }
        }

Same methods

GList::SetVirtual ( ) : void

Usage Example

示例#1
0
 static public int SetVirtual(IntPtr l)
 {
     try {
         FairyGUI.GList self = (FairyGUI.GList)checkSelf(l);
         self.SetVirtual();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.GList::SetVirtual