private void ShowPortalBear(PortalTypeEnum portal)
    {
        if (portal == PortalTypeEnum.x_ray && PortalPlayerControl.currType != portal)
        {
            basic_bear.SetActive(false);
            time_bear.SetActive(false);
            artist_bear.SetActive(false);
            x_ray_bear.SetActive(true);

            PortalPlayerControl.currType = portal;
            myAudioSource.Play();
        }

        if (portal == PortalTypeEnum.time_period && PortalPlayerControl.currType != portal)
        {
            basic_bear.SetActive(false);
            x_ray_bear.SetActive(false);
            artist_bear.SetActive(false);
            time_bear.SetActive(true);

            PortalPlayerControl.currType = portal;
            myAudioSource.Play();
        }

        if (portal == PortalTypeEnum.artist && PortalPlayerControl.currType != portal)
        {
            basic_bear.SetActive(false);
            x_ray_bear.SetActive(false);
            artist_bear.SetActive(true);
            time_bear.SetActive(false);

            PortalPlayerControl.currType = portal;
            myAudioSource.Play();
        }

        if (portal == PortalTypeEnum.basic_info && PortalPlayerControl.currType != portal)
        {
            x_ray_bear.SetActive(false);
            time_bear.SetActive(false);
            basic_bear.SetActive(true);
            artist_bear.SetActive(false);

            PortalPlayerControl.currType = portal;
            myAudioSource.Play();
        }
    }
Exemplo n.º 2
0
        public ListWithTotalCountResult <Feedback> GetFeedbackList(int start, int count, FeedbackSortEnum sort, SortDirectionEnumContract sortDirection,
                                                                   IList <FeedbackCategoryEnum> filterCategories, PortalTypeEnum portalType)
        {
            var query = GetSession().QueryOver <Feedback>()
                        .Fetch(SelectMode.Fetch, x => x.AuthorUser)
                        .Where(x => x.PortalType == portalType);

            IQueryOverOrderBuilder <Feedback, Feedback> queryOrder;

            switch (sort)
            {
            case FeedbackSortEnum.Date:
                queryOrder = query.OrderBy(x => x.CreateTime);
                break;

            case FeedbackSortEnum.Category:
                queryOrder = query.OrderBy(x => x.FeedbackCategory);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(sort), sort, null);
            }

            switch (sortDirection)
            {
            case SortDirectionEnumContract.Asc:
                query = queryOrder.Asc;
                break;

            case SortDirectionEnumContract.Desc:
                query = queryOrder.Desc;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(sortDirection), sortDirection, null);
            }

            if (sort == FeedbackSortEnum.Category)
            {
                query = query.ThenBy(x => x.CreateTime).Desc;
            }

            if (filterCategories.Count > 0)
            {
                query = query.WhereRestrictionOn(x => x.FeedbackCategory).IsInG(filterCategories);
            }

            var list = query.Skip(start)
                       .Take(count)
                       .Future();

            var totalCount = query.ToRowCountQuery()
                             .FutureValue <int>();

            return(new ListWithTotalCountResult <Feedback>
            {
                List = list.ToList(),
                Count = totalCount.Value,
            });
        }
Exemplo n.º 3
0
        public virtual ListWithTotalCountResult <NewsSyndicationItem> GetNewsSyndicationItems(int start, int count, SyndicationItemType?type, PortalTypeEnum portalType)
        {
            var query = GetSession().QueryOver <NewsSyndicationItem>()
                        .Fetch(SelectMode.Fetch, x => x.User)
                        .Where(x => x.PortalType == portalType)
                        .OrderBy(x => x.CreateTime).Desc;

            if (type != null)
            {
                query = query.Where(x => x.ItemType == type || x.ItemType == SyndicationItemType.Combined);
            }

            var list = query.Skip(start)
                       .Take(count)
                       .Future();

            var totalCount = query.ToRowCountQuery()
                             .FutureValue <int>();

            return(new ListWithTotalCountResult <NewsSyndicationItem>
            {
                List = list.ToList(),
                Count = totalCount.Value,
            });
        }