Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     starManager         = GameObject.Find("StarManager").GetComponent <StarsManager>();
     heartManager        = GameObject.Find("HeartManager").GetComponent <HeartManager>();
     characterController = this.GetComponent <CharacterController>();
     animation           = this.GetComponent <Animation>();
 }
Пример #2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var totalCount   = TranslateUtils.ToInt(TotalCount.Text);
                var pointAverage = TranslateUtils.ToDecimal(PointAverage.Text);
                if (totalCount == 0)
                {
                    pointAverage = 0;
                }
                else if (pointAverage == 0)
                {
                    totalCount = 0;
                }

                StarsManager.SetStarSetting(PublishmentSystemId, _channelId, _contentId, totalCount, pointAverage);

                Body.AddSiteLog(PublishmentSystemId, _channelId, _contentId, "设置内容评分值", string.Empty);

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, "评分设置失败!");
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page);
            }
        }
Пример #3
0
    void Awake()
    {
        gravity = GetComponent <Gravity>();
        number  = StarsManager.GetNumber();

        Init();
        oldPower = starConfig.power;
    }
Пример #4
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(gameObject);
        }

        stars = new List <StarController>();
        stars.Add(defaultCenterStar);
        mainCamera = Camera.main;
    }
Пример #5
0
        private AtomEntry ExportContentInfo(ContentInfo contentInfo)
        {
            var entry = AtomUtility.GetEmptyEntry();

            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Id, contentInfo.Id.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.NodeId, contentInfo.NodeId.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.PublishmentSystemId, contentInfo.PublishmentSystemId.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.AddUserName, contentInfo.AddUserName);
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.LastEditUserName, contentInfo.LastEditUserName);
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.LastEditDate, contentInfo.LastEditDate.ToString(CultureInfo.InvariantCulture));
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Taxis, contentInfo.Taxis.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.ContentGroupNameCollection, contentInfo.ContentGroupNameCollection);
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Tags, AtomUtility.Encrypt(contentInfo.Tags));
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.IsChecked, contentInfo.IsChecked.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.CheckedLevel, contentInfo.CheckedLevel.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Comments, contentInfo.Comments.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Photos, contentInfo.Photos.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Hits, contentInfo.Hits.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.HitsByDay, contentInfo.HitsByDay.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.HitsByWeek, contentInfo.HitsByWeek.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.HitsByMonth, contentInfo.HitsByMonth.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.LastHitsDate, contentInfo.LastHitsDate.ToString(CultureInfo.InvariantCulture));

            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.Title, AtomUtility.Encrypt(contentInfo.Title));
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.IsTop, contentInfo.IsTop.ToString());
            AtomUtility.AddDcElement(entry.AdditionalElements, ContentAttribute.AddDate, contentInfo.AddDate.ToString(CultureInfo.InvariantCulture));

            var starSetting = StarsManager.GetStarSettingToExport(_publishmentSystemInfo.PublishmentSystemId, contentInfo.NodeId, contentInfo.Id);

            AtomUtility.AddDcElement(entry.AdditionalElements, BackgroundContentAttribute.StarSetting, starSetting);

            foreach (string attributeName in contentInfo.Attributes.Keys)
            {
                if (!ContentAttribute.AllAttributes.Contains(attributeName.ToLower()))
                {
                    AtomUtility.AddDcElement(entry.AdditionalElements, attributeName, AtomUtility.Encrypt(contentInfo.Attributes[attributeName]));
                }
            }

            if (contentInfo.Photos > 0)
            {
                _photoIe.ExportPhoto(contentInfo.Id);
            }

            return(entry);
        }
Пример #6
0
    public void Awake()
    {
        levelInfo      = LevelManager.Instance.GetLevel(levelNumb);
        isStarTaken[0] = levelInfo.stars[0];
        isStarTaken[1] = levelInfo.stars[1];
        isStarTaken[2] = levelInfo.stars[2];
        if (isStarTaken[0])
        {
            star[0].gameObject.SetActive(false);
        }
        if (isStarTaken[1])
        {
            star[1].gameObject.SetActive(false);
        }
        if (isStarTaken[2])
        {
            star[2].gameObject.SetActive(false);
        }

        if (instance == null)
        {
            instance = this;
        }
    }
Пример #7
0
        private static string GetColumnValue(Hashtable valueHashtable, ETableStyle tableStyle, PublishmentSystemInfo publishmentSystemInfo, ContentInfo contentInfo, TableStyleInfo styleInfo)
        {
            var value = string.Empty;

            if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.AddUserName))
            {
                if (!string.IsNullOrEmpty(contentInfo.AddUserName))
                {
                    var key = ContentAttribute.AddUserName + ":" + contentInfo.AddUserName;
                    value = valueHashtable[key] as string;
                    if (value == null)
                    {
                        value =
                            $@"<a rel=""popover"" class=""popover-hover"" data-content=""{AdminManager.GetFullName(
                                contentInfo.AddUserName)}"" data-original-title=""管理员"">{AdminManager.GetDisplayName(
                                contentInfo.AddUserName, false)}</a>";
                        valueHashtable[key] = value;
                    }
                }
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.LastEditUserName))
            {
                if (!string.IsNullOrEmpty(contentInfo.LastEditUserName))
                {
                    var key = ContentAttribute.LastEditUserName + ":" + contentInfo.LastEditUserName;
                    value = valueHashtable[key] as string;
                    if (value == null)
                    {
                        value =
                            $@"<a rel=""popover"" class=""popover-hover"" data-content=""{AdminManager.GetFullName(
                                contentInfo.LastEditUserName)}"" data-original-title=""管理员"">{AdminManager.GetDisplayName(
                                contentInfo.LastEditUserName, false)}</a>";
                        valueHashtable[key] = value;
                    }
                }
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.CheckUserName))
            {
                var checkUserName = contentInfo.GetExtendedAttribute(ContentAttribute.CheckUserName);
                if (!string.IsNullOrEmpty(checkUserName))
                {
                    var key = ContentAttribute.CheckUserName + ":" + checkUserName;
                    value = valueHashtable[key] as string;
                    if (value == null)
                    {
                        value =
                            $@"<a rel=""popover"" class=""popover-hover"" data-content=""{AdminManager.GetFullName(
                                checkUserName)}"" data-original-title=""管理员"">{AdminManager.GetDisplayName(checkUserName,
                                false)}</a>";

                        valueHashtable[key] = value;
                    }
                }
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.CheckCheckDate))
            {
                var checkDate = contentInfo.GetExtendedAttribute(ContentAttribute.CheckCheckDate);
                if (!string.IsNullOrEmpty(checkDate))
                {
                    value = DateUtils.GetDateAndTimeString(TranslateUtils.ToDateTime(checkDate));
                }
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.CheckReasons))
            {
                value = contentInfo.GetExtendedAttribute(ContentAttribute.CheckReasons);
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.AddDate))
            {
                value = DateUtils.GetDateString(contentInfo.AddDate);
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.LastEditDate))
            {
                value = DateUtils.GetDateString(contentInfo.LastEditDate);
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.SourceId))
            {
                value = SourceManager.GetSourceName(contentInfo.SourceId);
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.Tags))
            {
                value = contentInfo.Tags;
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.ContentGroupNameCollection))
            {
                value = contentInfo.ContentGroupNameCollection;
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.Hits))
            {
                value = contentInfo.Hits.ToString();
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.HitsByDay))
            {
                value = contentInfo.HitsByDay.ToString();
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.HitsByWeek))
            {
                value = contentInfo.HitsByWeek.ToString();
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.HitsByMonth))
            {
                value = contentInfo.HitsByMonth.ToString();
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.LastHitsDate))
            {
                value = DateUtils.GetDateAndTimeString(contentInfo.LastHitsDate);
            }
            else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, ContentAttribute.IsTop))
            {
                value = StringUtils.GetTrueImageHtml(contentInfo.IsTop);
            }
            else
            {
                var isSettting = false;
                if (tableStyle == ETableStyle.BackgroundContent)
                {
                    isSettting = true;
                    if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.Star))
                    {
                        var showPopWinString = ModalContentStarSet.GetOpenWindowString(publishmentSystemInfo.PublishmentSystemId, contentInfo.NodeId, contentInfo.Id);
                        value =
                            $@"<a href=""javascript:;"" onclick=""{showPopWinString}"" title=""点击设置评分"">{StarsManager
                                .GetStarString(publishmentSystemInfo.PublishmentSystemId, contentInfo.NodeId, contentInfo.Id)}</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.Digg))
                    {
                        var    showPopWinString = ModalContentDiggSet.GetOpenWindowString(publishmentSystemInfo.PublishmentSystemId, contentInfo.NodeId, contentInfo.Id);
                        var    nums             = BaiRongDataProvider.DiggDao.GetCount(publishmentSystemInfo.PublishmentSystemId, contentInfo.Id);
                        string display          = $"赞同:{nums[0]} 不赞同:{nums[1]}";
                        value =
                            $@"<a href=""javascript:;"" onclick=""{showPopWinString}"" title=""点击设置Digg数"">{display}</a>";
                    }
                    else if (StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.IsColor) || StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.IsHot) || StringUtils.EqualsIgnoreCase(styleInfo.AttributeName, BackgroundContentAttribute.IsRecommend))
                    {
                        value = StringUtils.GetTrueImageHtml(contentInfo.GetExtendedAttribute(styleInfo.AttributeName));
                    }
                    else
                    {
                        isSettting = false;
                    }
                }

                if (!isSettting)
                {
                    value = InputParserUtility.GetContentByTableStyle(contentInfo.GetExtendedAttribute(styleInfo.AttributeName), publishmentSystemInfo, tableStyle, styleInfo);
                }
            }
            return(value);
        }
Пример #8
0
 void Start()
 {
     stars = FindObjectOfType <StarsManager>();
     stars?.UpdateStars(alertLevel);
 }
Пример #9
0
    // Update is called once per frame

    void Start()
    {
        starManager = GameObject.Find("StarManager").GetComponent <StarsManager>();
    }
Пример #10
0
    void Start()
    {
        starManager = StarsManager.Instance;

        InitGame();
    }
Пример #11
0
        // 内部消化掉错误
        private void ImportContents(AtomEntryCollection entries, NodeInfo nodeInfo, int taxis, int importStart, int importCount, bool isCheckedBySettings, bool isChecked, int checkedLevel, bool isOverride)
        {
            if (importStart > 1 || importCount > 0)
            {
                var theEntries = new AtomEntryCollection();

                if (importStart == 0)
                {
                    importStart = 1;
                }
                if (importCount == 0)
                {
                    importCount = entries.Count;
                }

                var firstIndex = entries.Count - importStart - importCount + 1;
                if (firstIndex <= 0)
                {
                    firstIndex = 0;
                }

                var addCount = 0;
                for (var i = 0; i < entries.Count; i++)
                {
                    if (addCount >= importCount)
                    {
                        break;
                    }
                    if (i >= firstIndex)
                    {
                        theEntries.Add(entries[i]);
                        addCount++;
                    }
                }

                entries = theEntries;
            }

            var tableName = NodeManager.GetTableName(_publishmentSystemInfo, nodeInfo);

            foreach (AtomEntry entry in entries)
            {
                try
                {
                    taxis++;
                    var contentIdFromFile          = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Id));
                    var lastEditDate               = AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.LastEditDate);
                    var contentGroupNameCollection = AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.ContentGroupNameCollection);
                    if (isCheckedBySettings)
                    {
                        isChecked    = TranslateUtils.ToBool(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.IsChecked));
                        checkedLevel = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.CheckedLevel));
                    }
                    var comments     = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Comments));
                    var photos       = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Photos));
                    var hits         = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Hits));
                    var hitsByDay    = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.HitsByDay));
                    var hitsByWeek   = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.HitsByWeek));
                    var hitsByMonth  = TranslateUtils.ToInt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.HitsByMonth));
                    var lastHitsDate = AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.LastHitsDate);
                    var title        = AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Title);
                    var isTop        = TranslateUtils.ToBool(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.IsTop));
                    var addDate      = AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.AddDate);

                    var topTaxis = 0;
                    if (isTop)
                    {
                        topTaxis = taxis - 1;
                        taxis    = BaiRongDataProvider.ContentDao.GetMaxTaxis(tableName, nodeInfo.NodeId, true) + 1;
                    }
                    var tags = AtomUtility.Decrypt(AtomUtility.GetDcElementContent(entry.AdditionalElements, ContentAttribute.Tags));

                    var starSetting = AtomUtility.GetDcElementContent(entry.AdditionalElements, BackgroundContentAttribute.StarSetting);

                    var contentInfo = new ContentInfo
                    {
                        NodeId = nodeInfo.NodeId,
                        PublishmentSystemId = _publishmentSystemInfo.PublishmentSystemId,
                        AddUserName         = RequestBody.CurrentAdministratorName,
                        AddDate             = TranslateUtils.ToDateTime(addDate)
                    };
                    contentInfo.LastEditUserName           = contentInfo.AddUserName;
                    contentInfo.LastEditDate               = TranslateUtils.ToDateTime(lastEditDate);
                    contentInfo.ContentGroupNameCollection = contentGroupNameCollection;
                    contentInfo.Tags         = tags;
                    contentInfo.IsChecked    = isChecked;
                    contentInfo.CheckedLevel = checkedLevel;
                    contentInfo.Comments     = comments;
                    contentInfo.Photos       = photos;
                    contentInfo.Hits         = hits;
                    contentInfo.HitsByDay    = hitsByDay;
                    contentInfo.HitsByWeek   = hitsByWeek;
                    contentInfo.HitsByMonth  = hitsByMonth;
                    contentInfo.LastHitsDate = TranslateUtils.ToDateTime(lastHitsDate);
                    contentInfo.Title        = AtomUtility.Decrypt(title);
                    contentInfo.IsTop        = isTop;

                    var attributes = AtomUtility.GetDcElementNameValueCollection(entry.AdditionalElements);
                    foreach (string attributeName in attributes.Keys)
                    {
                        if (!contentInfo.ContainsKey(attributeName.ToLower()))
                        {
                            contentInfo.Attributes[attributeName] = AtomUtility.Decrypt(attributes[attributeName]);
                        }
                    }

                    var isInsert = false;
                    if (isOverride)
                    {
                        var existsIDs = DataProvider.ContentDao.GetIdListBySameTitleInOneNode(tableName, contentInfo.NodeId, contentInfo.Title);
                        if (existsIDs.Count > 0)
                        {
                            foreach (int id in existsIDs)
                            {
                                contentInfo.Id = id;
                                DataProvider.ContentDao.Update(tableName, _fso.PublishmentSystemInfo, contentInfo);
                            }
                        }
                        else
                        {
                            isInsert = true;
                        }
                    }
                    else
                    {
                        isInsert = true;
                    }

                    if (isInsert)
                    {
                        var contentId = DataProvider.ContentDao.Insert(tableName, _publishmentSystemInfo, contentInfo, false, taxis);
                        if (photos > 0)
                        {
                            _photoIe.ImportPhoto(contentIdFromFile, contentId);
                        }

                        if (_publishmentSystemInfo.Additional.IsRelatedByTags && !string.IsNullOrEmpty(tags))
                        {
                            var tagCollection = TagUtils.ParseTagsString(tags);
                            TagUtils.AddTags(tagCollection, _publishmentSystemInfo.PublishmentSystemId, contentId);
                        }

                        if (!string.IsNullOrEmpty(starSetting))
                        {
                            var settings = starSetting.Split('_');
                            if (settings != null && settings.Length == 2)
                            {
                                var totalCount   = TranslateUtils.ToInt(settings[0]);
                                var pointAverage = TranslateUtils.ToDecimal(settings[1]);
                                StarsManager.SetStarSetting(_publishmentSystemInfo.PublishmentSystemId, contentInfo.NodeId, contentId, totalCount, pointAverage);
                            }
                        }
                    }
                    //this.FSO.AddContentToWaitingCreate(contentInfo.NodeID, contentID);

                    if (isTop)
                    {
                        taxis = topTaxis;
                    }
                }
                catch
                {
                    // ignored
                }
            }
        }