Example #1
0
        public void OnSetUpItems()
        {
            MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;

            if (instance.CurrentState != MyPhoton.MyState.LOBBY)
            {
                return;
            }
            if (this.m_Rooms == null)
            {
                this.m_Rooms = new List <MyPhoton.MyRoom>();
            }
            this.m_Rooms.Clear();
            List <MyPhoton.MyRoom> roomList = instance.GetRoomList();

            for (int index = 0; index < roomList.Count; ++index)
            {
                if (roomList[index].lobby == this.VS_LOBBY_NAME && roomList[index].name.IndexOf(this.VS_FRIEND_SUFFIX) == -1 && roomList[index].start)
                {
                    this.m_Rooms.Add(roomList[index]);
                }
            }
            this.m_Max = this.m_Rooms.Count;
            ScrollListController component1 = (ScrollListController)((Component)this).GetComponent <ScrollListController>();

            ScrollListController.OnItemPositionChange onItemUpdate = component1.OnItemUpdate;
            ScrollClamped_VersusViewList clampedVersusViewList     = this;
            // ISSUE: virtual method pointer
            UnityAction <int, GameObject> unityAction = new UnityAction <int, GameObject>((object)clampedVersusViewList, __vmethodptr(clampedVersusViewList, OnUpdateItems));

            onItemUpdate.AddListener(unityAction);
            ((ScrollRect)((Component)this).GetComponentInParent <ScrollRect>()).set_movementType((ScrollRect.MovementType) 2);
            RectTransform component2       = (RectTransform)((Component)this).GetComponent <RectTransform>();
            Vector2       sizeDelta        = component2.get_sizeDelta();
            Vector2       anchoredPosition = component2.get_anchoredPosition();

            anchoredPosition.y = (__Null)0.0;
            sizeDelta.y        = (__Null)((double)component1.ItemScale * (double)this.Space * (double)this.m_Max);
            component2.set_sizeDelta(sizeDelta);
            component2.set_anchoredPosition(anchoredPosition);
        }