Esempio n. 1
0
        /// <summary>
        /// 检测是否有消息
        /// </summary>
        public void detectLoudspeakerMessage()
        {
            // 获取一个喇叭滚动条
            LoudspeakerContentItem noticeItem = getFreeLoudspeakerItem();

            if (noticeItem == null)
            {
                return;
            }

            // 获取一个公告
            if (!LogicDataCenter.loudspeakerManager.HasLoudspeakerMessage())
            {
                return;
            }
            LoudspeakerManager.SLoudspeakerInfo info = LogicDataCenter.loudspeakerManager.GetLoudspeakerMessage();
            LoudspeakerContentItemData          data = new LoudspeakerContentItemData();

            data.info = info;

            // 设置数据
            noticeItem.SetData(data);

            // 开始滚动
            noticeItem.Run();
        }
Esempio n. 2
0
        public void SetData(LoudspeakerContentItemData data)
        {
            float offsetX = 0f;
            float offsetY = 0f;

            List <LineObjCache> curLineObject = new List <LineObjCache>();

            if (data.info.objList != null)
            {
                foreach (var obj in data.info.objList)
                {
                    CreateSubItem(obj, curLineObject);
                }
            }
            AlignLineObject(ref offsetX, ref offsetY, curLineObject);

            m_fCurWidth = offsetX;
        }