示例#1
0
        private void ItemPageChangedHandle(PageChangedEventArg pageChangedEventArg)
        {
            SoundManager.Instance.PlaySoundEffect("Sound_Button_Page");
            int startIndex = (pageChangedEventArg.StartPage - 1) * pageChangedEventArg.PageSize;

            if (m_roleListInfo.Length < startIndex)
            {
                TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "分页出错 总数:" + m_roleListInfo.Length + " 开始:" + startIndex);
            }
            int itemCount = startIndex + pageChangedEventArg.PageSize > m_roleListInfo.Length ? m_roleListInfo.Length : startIndex + pageChangedEventArg.PageSize;

            IPagerItem[] roleItems = new IPagerItem[itemCount - startIndex];
            GameObject   roleItem;

            for (int i = startIndex; i < itemCount; i++)
            {
                roleItem      = GameObject.Instantiate(RoleSelectItemPrefab) as GameObject;
                roleItem.name = RoleSelectItemPrefab.name;
                var item       = m_roleListInfo[i];
                var commonItem = roleItem.GetComponent <RoleSelectItem>();
                commonItem.InitItemData(item);
                roleItems[i - startIndex] = commonItem;
            }

            ItemPagerManager.UpdateItems(roleItems, RoleSelectItemPrefab.name);
        }
示例#2
0
        public void ItemPageChanged(PageChangedEventArg pageSmg)
        {
            TeamInfoItemList.ApplyAllItem(p =>
            {
                p.transform.position = new Vector3(-2000, 0, 0);
                //p.gameObject.SetActive(false);
            });
            int size = ItemPageManager_Team.PagerSize;
            var showTeamInfoArray = TeamInfoItemList.Skip((pageSmg.StartPage - 1) * size).Take(size).ToArray();

            //showTeamInfoArray.ApplyAllItem(p =>
            //    {
            //        p.gameObject.SetActive(true);
            //        var tweenScele = p.GetComponentInChildren<TweenScale>();
            //        tweenScele.Reset();
            //        tweenScele.Play(true);
            //    });
            ItemPageManager_Team.UpdateItems(showTeamInfoArray, "teamList");

            //加入百叶窗效果
            int arrayLength = showTeamInfoArray.Length;

            for (int i = 0; i < arrayLength; i++)
            {
                showTeamInfoArray[i].PlayShutterAnimation(i * 0.1f);
            }
        }
示例#3
0
    private void ChangePage(int currentPage)
    {
        if (null != PagerCaption)
        {
            PagerCaption.text = string.Format("{0}/{1}", currentPage, m_pagerSize);
        }

        if (PreviousPage != null && PreviousPage.BackgroundSprite != null)
        {
            PreviousPage.BackgroundSprite.alpha = currentPage <= 1 ? 0.5f : 1f;
            PreviousPage.SetButtonColliderActive(currentPage > 1);
        }
        if (NextPage != null && NextPage.BackgroundSprite != null)
        {
            NextPage.BackgroundSprite.alpha = currentPage >= m_pagerSize ? 0.5f : 1f;
            NextPage.SetButtonColliderActive(currentPage < m_pagerSize);
        }
        //发出页面改变消息
        //int startPage = (currentPage - 1) * ITEM_SIZE_IN_PAGER;
        int count = PagerSize;
        PageChangedEventArg pageChangedEventArg = new PageChangedEventArg(currentPage, count);

        if (OnPageChanged != null)
        {
            OnPageChanged(pageChangedEventArg);
        }
        //RaiseEvent(EventTypeEnum.PageChanged.ToString(), pageChangedEventArg);
    }
示例#4
0
 //翻页
 void OnPageChanged(PageChangedEventArg arg)
 {
     //m_SirenItemDict.Values.ApplyAllItem(p =>
     //    {
     //        p.transform.position = new Vector3(-2000, 0, 0);
     //    });
     //int size = ItemPageManager_Siren.ItemBgs.Length;
     //var sirenArray = m_SirenItemDict.Values.Skip((arg.StartPage - 1) * size).Take(size).ToArray();
     //ItemPageManager_Siren.UpdateItems(sirenArray, "SirenList");
 }
示例#5
0
        void ItemPageChangedHandle(PageChangedEventArg pageChangedEventArg)
        {
            m_rankInfoCtrlList.ApplyAllItem(p =>
            {
                p.transform.position = new Vector3(-2000, 0, 0);
            });
            int size = ItemPageManager_Rank.PagerSize;

            ItemPageManager_Rank.UpdateItems(m_rankInfoCtrlList.Skip((pageChangedEventArg.StartPage - 1) * size).Take(size).ToArray(), "rank");
        }
示例#6
0
        void ItemPageChangedHandle(PageChangedEventArg pageSmg)
        {
            m_FriendList.ApplyAllItem(p => {
                p.gameObject.SetActive(false);
            });
            int size            = ItemPagerManager_Friend.PagerSize;
            var showFriendArray = m_FriendList.Skip((pageSmg.StartPage - 1) * size).Take(size).ToArray();

            showFriendArray.ApplyAllItem(p => {
                p.gameObject.SetActive(true);
            });
            ItemPagerManager_Friend.UpdateItems(showFriendArray, "friendList");
        }
示例#7
0
 //翻页消息监听
 void ItemPageChangedHandle(PageChangedEventArg pageSmg)
 {
     TeamOrganizePanel.ItemPageChanged(pageSmg);
 }
示例#8
0
//		void UpdateViaNotify(INotifyArgs arg)
//		{
//			var playerData = PlayerManager.Instance.FindHeroDataModel();
//			Label_Ingot.text = playerData.PlayerValues.PLAYER_FIELD_BINDPAY.ToString();
//			Label_Active.text = playerData.PlayerValues.PLAYER_FIELD_CURRENCY_ACTIVELIFE.ToString();
//		}

        //翻页消息监听
        void ItemPageChangedHandle(PageChangedEventArg pageSmg)
        {
            TeamListPanel.ItemPageChanged(pageSmg);
        }