Пример #1
0
 public static LobbyRowType2 Create(DataLobby data, UITable parent)
 {
     GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType2")) as GameObject;
     go.transform.parent = parent.transform;
     go.transform.localPosition = Vector3.zero;
     go.transform.localScale = Vector3.one;
     go.GetComponent<UIDragScrollView>().scrollView = parent.GetComponentInParent<UIScrollView>();
     go.name = data.roomId + " - " + data.roomName;
     LobbyRowType2 item = go.GetComponent<LobbyRowType2>();
     item.setData(data);
     return item;
 }
Пример #2
0
    public static LobbyRowType1 Create(DataLobby data, UITable parent, Action <DataLobby> callBack)
    {
        GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType1")) as GameObject;

        go.transform.parent        = parent.transform;
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale    = Vector3.one;
        go.GetComponent <UIDragScrollView>().scrollView = parent.GetComponentInParent <UIScrollView>();
        go.name = "#" + data.roomId;
        LobbyRowType1 item = go.GetComponent <LobbyRowType1>();

        item.setData(data);
        item.action = callBack;
        return(item);
    }
Пример #3
0
        protected override void InitUI()
        {
            base.InitUI();

            //初始化对象池
            _tabCache  = new FRenderCache <UIToggle>(tabTable, tabItemPrefab);
            _pageCache = new FRenderCache <GameObject>(pageTable, pageItemPrefab);

            //默认隐藏小箭头
            if (previous)
            {
                previous.gameObject.SetActive(false);
            }
            if (next)
            {
                next.gameObject.SetActive(false);
            }

            if (tabTable)
            {
                _tabScrollView = tabTable.GetComponentInParent <UIScrollView>();
                if (_tabScrollView)
                {
                    _tabScrollView.onMoving += SetTabArrowStatus;
                }
            }

            if (pageTable)
            {
                _centerOnChild = pageTable.GetComponent <UICenterOnChild>();
                if (_centerOnChild)
                {
                    _centerOnChild.onCenter = PageOnCenter;
                }
                _pageDragScrollView = pageTable.GetComponentInParent <UIDragScrollView>();
            }
        }