コード例 #1
0
ファイル: UIMultiScroller.cs プロジェクト: ZengHuiAn/sgk
    void Start()
    {
        GetComponent <ScrollRect>().inertia = inertia;
        if (RefreshIconCallback == null)
        {
            RefreshIconCallback = func;
        }

        if (_movement == Arrangement.Vertical)
        {
            viewCount = Mathf.FloorToInt(this.GetComponent <RectTransform>().rect.height / cellHeight) + 2;
        }
        else
        {
            viewCount = Mathf.FloorToInt(this.GetComponent <RectTransform>().rect.width / cellWidth) + 2;
        }
        if (test)
        {
            DataCount = 30;
        }
        else
        {
            DataCount = _dataCount;
        }
        OnValueChange(Vector2.zero);
        RefMax = _itemList.Count;
        //continue.Start();
        //StartCoroutine(ShowItems());
        //maxViewCount = maxPerLine * viewCount;
        //ShowItems();
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     rect = transform.GetComponent <ScrollRect>();
     if (RefreshCallback == null)
     {
         RefreshCallback = func;
     }
 }
コード例 #3
0
ファイル: UIMultiScroller.cs プロジェクト: ZengHuiAn/sgk
 private void OnDestroy()
 {
     RefreshIconCallback = null;
 }