Exemple #1
0
    /// <summary>
    /// 扩展ScrollRect,增加AddItem的方法
    /// </summary>
    /// <param name="scr">ScrollRect</param>
    /// <param name="item">要加的Item</param>
    static public GameObject AddItem(this ScrollRect scr, GameObject item)
    {
        var com = SFScrollRectExtension.Get(scr.gameObject);

        if (com != null)
        {
            return(com.addItem(item));
        }
        return(null);
    }
Exemple #2
0
    /// <summary>
    /// 设置填充类型
    /// </summary>
    /// <param name="scr">ScrollRect.</param>
    /// <param name="type">1-Vertical 2-Horizonal</param>
    static public void SetFillType(this ScrollRect scr, int type)
    {
        var com = SFScrollRectExtension.Get(scr.gameObject);

        if (com != null)
        {
            if (type == 1 || type == 2)
            {
                com.fillType = type;
            }
        }
    }