Beispiel #1
0
        /// <summary>
        /// 调整(调整顶点坐标)
        /// </summary>
        /// <param name="cd">字符数据</param>
        /// <param name="frag">片段数据</param>
        public override void adjust(QuestionTextParser.CharData cd, FragmentData frag)
        {
            var offset = textObj.enterHeight * OffsetRate;

            cd.offset(0, -offset);
            base.adjust(cd, frag);
        }
Beispiel #2
0
        /// <summary>
        /// 处理(进行实际处理)
        /// </summary>
        /// <param name="cd">字符数据</param>
        /// <param name="frag">片段数据</param>
        public override void handle(QuestionTextParser.CharData cd, FragmentData frag)
        {
            QuestionText.TestLog("handle: "); cd.display();
            var image = getImageObject(handleCnt);

            setImagePosition(image, cd.verts);
            base.handle(cd, frag);
        }
Beispiel #3
0
 /// <summary>
 /// 增加一个字符数据
 /// </summary>
 /// <param name="cd">字符数据</param>
 public void addCharData(QuestionTextParser.CharData cd)
 {
     charData.Add(cd);
     foreach (var child in children)
     {
         if (child.inside(cd.index))
         {
             child.addCharData(cd);
         }
     }
 }
Beispiel #4
0
        /// <summary>
        /// 预处理
        /// </summary>
        /// <param name="cd">字符数据</param>
        /// <param name="frag">片段数据</param>
        public override void config(QuestionTextParser.CharData cd, FragmentData frag)
        {
            var image = getImageObject(imageCnt++);

            if (embedImage())
            {
                Texture2D texture; float width, height;
                var       mw = textObj.rectTransform.rect.width;
                getMatchInfo(frag, mw, out texture, out width, out height);
                setImageTexture(image, texture, width, height);
                setRectTransform(image.rectTransform, width, height);
            }
            else
            {
                var index = getTextureIndex(frag);
                var size  = setImageLink(image, index);
                setRectTransform(image.rectTransform, size.x, size.y);
            }
            base.config(cd, frag);
        }
Beispiel #5
0
 /// <summary>
 /// 处理(进行实际处理)
 /// </summary>
 /// <param name="cd">字符数据</param>
 /// <param name="frag">片段数据</param>
 public virtual void handle(QuestionTextParser.CharData cd,
                            FragmentData frag)
 {
     handleCnt++;
 }
Beispiel #6
0
 /// <summary>
 /// 调整(调整顶点坐标)
 /// </summary>
 /// <param name="cd">字符数据</param>
 /// <param name="frag">片段数据</param>
 public virtual void adjust(QuestionTextParser.CharData cd,
                            FragmentData frag)
 {
     adjustCnt++;
 }
Beispiel #7
0
 /// <summary>
 /// 配置(OnPopulateMesh 前执行)
 /// </summary>
 /// <param name="cd">字符数据</param>
 /// <param name="frag">片段数据</param>
 public virtual void config(QuestionTextParser.CharData cd,
                            FragmentData frag)
 {
     configCnt++;
 }