Ejemplo n.º 1
0
        public void ResfresMyFriendItemData(List <FriendInfo> dataList, long playerId)
        {
            myFriendScrollView.gameObject.SetActive(true);
            myFriendScrollView.InitializeWithData(dataList);
            myFriendScrollView.GoTop();

            int index = 0;

            for (int i = 0; i < dataList.Count; i++)
            {
                if (dataList [i].friendId == playerId)
                {
                    index = i;
                    break;
                }
            }

            myFriendScrollView.ShowItemByDataIndex(index);

            MyFriendItem myFriendItem = myFriendScrollView.FindMyFriendItemByPlayerId(playerId);

            myFriendItem.selectedMyFriendItemIndex = myFriendItem.GetPlayerId();
            OnClickMyFriendItemCallBack(myFriendItem);
            friendNumberInfoText.text = string.Format("{0}/{1}", controller.GetFriendOnLineNumber(), dataList.Count);
            myFriendScrollView.UpdateScrollView(Vector2.zero);
        }
Ejemplo n.º 2
0
        public override GameObject InstantiateCell()
        {
            MyFriendItem item = base.InstantiateCell().AddComponent <MyFriendItem>();

            myFriendItemList.Add(item);
            if (OnCreateItemHandler != null)
            {
                OnCreateItemHandler(item);
            }
            return(item.gameObject);
        }
Ejemplo n.º 3
0
        private void OnClickMyFriendItemCallBack(MyFriendItem item)
        {
            if (lastSelectedMyFriendItem != item && lastSelectedMyFriendItem != null)
            {
                lastSelectedMyFriendItem.CancelSelected();
            }

            item.SelectedItem();

            lastSelectedMyFriendItem = item;

            ShowPrivateChatScrollView(item.GetPlayerId());

            selectedMyFriendItemId = item.GetPlayerId();

            friendNameText.text = item.GetPlayerName();

            ResfresPrivateChatItemData(controller.GetPrivateChatData(selectedMyFriendItemId));
        }
Ejemplo n.º 4
0
 private void OnCreateFriendtem(MyFriendItem item)
 {
     item.onClickItemHandle = OnClickMyFriendItemCallBack;
 }